re PR fortran/41459 (Error not printed with -Werror and -fmax-errors=1)

2009-09-24  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/41459
	* gfortran.dg/empty_label.f: New test.
	* gfortran.dg/empty_label.f90: Ditto.
	* gfortran.dg/warnings_are_errors_1.f: Fix to emit a single warning.

2009-09-24  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/41459
	* error.c(gfc_warning_now): Move warnings_are_errors test to 
	after actual emitting of the warning.
	* parse.c (next_free): Improve error locus printing.
	(next_fixed): Change gfc_warn to gfc_warning_now, and improve
	locus reporting.

From-SVN: r152147
This commit is contained in:
Steven G. Kargl 2009-09-24 21:53:36 +00:00
parent e3d5405d07
commit bbffcb7eab
7 changed files with 35 additions and 5 deletions

View File

@ -1,3 +1,13 @@
2009-09-24 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/41459
* error.c(gfc_warning_now): Move warnings_are_errors test to
after actual emitting of the warning.
* parse.c (next_free): Improve error locus printing.
(next_fixed): Change gfc_warn to gfc_warning_now, and improve
locus reporting.
2009-09-16 Michael Matz <matz@suse.de>
PR fortran/41212

View File

@ -821,14 +821,16 @@ gfc_warning_now (const char *nocmsgid, ...)
i = buffer_flag;
buffer_flag = 0;
warnings++;
if (warnings_are_errors)
gfc_increment_error_count();
va_start (argp, nocmsgid);
error_print (_("Warning:"), _(nocmsgid), argp);
va_end (argp);
error_char ('\0');
if (warnings_are_errors)
gfc_increment_error_count();
buffer_flag = i;
}

View File

@ -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 ();

View File

@ -1,3 +1,10 @@
2009-09-24 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/41459
* gfortran.dg/empty_label.f: New test.
* gfortran.dg/empty_label.f90: Ditto.
* gfortran.dg/warnings_are_errors_1.f: Fix to emit a single warning.
2009-09-24 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gcc.dg/torture/builtin-math-7.c: Test complex int division at

View File

@ -0,0 +1,5 @@
C { dg-do compile }
C { dg-options "-Werror -fmax-errors=1" }
100 ! { dg-warning "empty statement" }
end
C { dg-error "count reached limit" "" { target *-*-* } 0 }

View File

@ -0,0 +1,5 @@
! { dg-do compile }
! { dg-options "-Werror -fmax-errors=1" }
100 ! { dg-warning "empty statement" }
end
! { dg-error "count reached limit" "" { target *-*-* } 0 }

View File

@ -8,7 +8,7 @@
integer(kind=1) :: i
real :: r1, r2(3)
! gfc_warning_now:
0 ! { dg-warning "Zero is not a valid statement label" }
0 r1 = 0 ! { dg-warning "Zero is not a valid statement label" }
!
34 5 i=0
! gfc_notify_std(GFC_STD_F95_DEL):