This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/41459] Error not printed with -Werror and -fmax-errors=1



------- Comment #1 from kargl at gcc dot gnu dot org  2009-09-24 14:19 -------
This is probably related to a difference between gfc_warning and
gfc_warning_now.  If you look in parse.c, you'll see free-form and
fixed-form code behave differently.  For fixed-form, no warning is
issued.  This patch fixes the fixed-form non-warning case.  It
also gives a better locus.

Index: parse.c
===================================================================
--- parse.c     (revision 151785)
+++ parse.c     (working copy)
@@ -655,7 +655,7 @@ next_free (void)
          if (gfc_match_eos () == MATCH_YES)
            {
              gfc_warning_now ("Ignoring statement label in empty statement "
-                              "at %C");
+                              "at %L", &label_locus);
              gfc_free_st_label (gfc_statement_label);
              gfc_statement_label = NULL;
              return ST_NONE;
@@ -848,7 +848,8 @@ next_fixed (void)

 blank_line:
   if (digit_flag)
-    gfc_warning ("Ignoring statement label in empty statement at %C");
+    gfc_warning_now ("Ignoring statement label in empty statement at %L",
+                    &label_locus);

   gfc_current_locus.lb->truncated = 0;
   gfc_advance_line ();


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41459


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]