This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/41459] Error not printed with -Werror and -fmax-errors=1
- From: "kargl at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Sep 2009 14:19:14 -0000
- Subject: [Bug fortran/41459] Error not printed with -Werror and -fmax-errors=1
- References: <bug-41459-16338@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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