* som.c (struct som_misc_symbol_info): Add is_comdat, is_common and
[deliverable/binutils-gdb.git] / gas / read.c
index 82c0434cbb46d91f500be3dba98325610deaf1dc..93e3ec41b171154d8db1fdcd52281237ec487eff 100644 (file)
@@ -1053,7 +1053,7 @@ read_a_source_file (char *name)
 #endif
          input_line_pointer--;
          /* Report unknown char as ignored.  */
-         ignore_rest_of_line ();
+         demand_empty_rest_of_line ();
        }
 
 #ifdef md_after_pass_hook
@@ -1155,6 +1155,9 @@ do_align (int n, char *fill, int len, int max)
       len = 0;
     }
 
+#ifdef md_flush_pending_output
+  md_flush_pending_output ();
+#endif
 #ifdef md_do_align
   md_do_align (n, fill, len, max, just_record_alignment);
 #endif
@@ -3020,6 +3023,10 @@ s_text (int ignore ATTRIBUTE_UNUSED)
 #endif
 }
 \f
+
+/* Verify that we are at the end of a line.  If not, issue an error and
+   skip to EOL.  */
+
 void
 demand_empty_rest_of_line (void)
 {
@@ -3027,28 +3034,29 @@ demand_empty_rest_of_line (void)
   if (is_end_of_line[(unsigned char) *input_line_pointer])
     input_line_pointer++;
   else
-    ignore_rest_of_line ();
-
-  /* Return having already swallowed end-of-line.  */
-}
-
-void
-ignore_rest_of_line (void)
-{
-  /* For suspect lines: gives warning.  */
-  if (!is_end_of_line[(unsigned char) *input_line_pointer])
     {
       if (ISPRINT (*input_line_pointer))
-       as_warn (_("rest of line ignored; first ignored character is `%c'"),
+       as_bad (_("junk at end of line, first unrecognized character is `%c'"),
                 *input_line_pointer);
       else
-       as_warn (_("rest of line ignored; first ignored character valued 0x%x"),
+       as_bad (_("junk at end of line, first unrecognized character valued 0x%x"),
                 *input_line_pointer);
-
-      while (input_line_pointer < buffer_limit
-            && !is_end_of_line[(unsigned char) *input_line_pointer])
-       input_line_pointer++;
+      ignore_rest_of_line ();
     }
+  
+  /* Return pointing just after end-of-line.  */
+  know (is_end_of_line[(unsigned char) input_line_pointer[-1]]);
+}
+
+/* Silently advance to the end of line.  Use this after already having
+   issued an error about something bad.  */
+
+void
+ignore_rest_of_line (void)
+{
+  while (input_line_pointer < buffer_limit
+        && !is_end_of_line[(unsigned char) *input_line_pointer])
+    input_line_pointer++;
 
   input_line_pointer++;
 
@@ -4372,6 +4380,10 @@ s_leb128 (int sign)
 {
   expressionS exp;
 
+#ifdef md_flush_pending_output
+  md_flush_pending_output ();
+#endif
+
   do
     {
       expression (&exp);
@@ -4734,7 +4746,7 @@ demand_copy_string (int *lenP)
     }
   else
     {
-      as_warn (_("missing string"));
+      as_bad (_("missing string"));
       retval = NULL;
       ignore_rest_of_line ();
     }
@@ -4810,7 +4822,7 @@ equals (char *sym_name, int reassign)
   if (flag_mri)
     {
       /* Check garbage after the expression.  */
-      ignore_rest_of_line ();
+      demand_empty_rest_of_line ();
       mri_comment_end (stop, stopc);
     }
 }
This page took 0.051282 seconds and 4 git commands to generate.