[patch] unify free- and fixed-form diagnostic messages

Bernhard Fischer rep.nop@aon.at
Wed Mar 22 11:18:00 GMT 2006


On Tue, Mar 21, 2006 at 08:42:18PM -0800, Jerry DeLisle wrote:
>Bernhard Fischer wrote:
>>Hi,
>>
>>Attached patch makes two warning messages consistent between fixed-form
>>and free-form.
>>
>>Ok for trunk and 4.1?

2006-03-21  Bernhard Fischer  <aldot@gcc.gnu.org>

	* parse.c (next_free): use consistent error string between
	free-form and fixed-form for illegal statement label of zero.
	(next_fixed): use consistent warning string between free-form
	and fixed-form for statement labels for empty statements.

2006-03-22  Bernhard Fischer  <aldot@gcc.gnu.org>

	* label_1.f90: Adjust dg-error.

>>
>Hi Bernard,
>
>On first glance this looks OK.  Have you regression tested to make sure we 
>do not have any dg-error checks in the testsuite that trigger off these 
>error messages? (I have not tested yet)

I forgot to include the diff to label_1.f90, sorry. Updated patch which
also corrects the label_1.f90 testcase is attached.
No, i didn't regression-test it.

-------------- next part --------------
--- gcc-4.2.oorig/gcc/fortran/parse.c	2006-02-21 14:05:18.000000000 +0100
+++ gcc-4.2/gcc/fortran/parse.c	2006-03-21 17:35:28.000000000 +0100
@@ -428,9 +428,9 @@ next_free (void)
 
           if (cnt > 5)
 	    gfc_error_now ("Too many digits in statement label at %C");
-	  
+
 	  if (c == 0)
-	    gfc_error_now ("Statement label at %C is zero");
+	    gfc_error_now ("Zero is not a valid statement label at %C");
 
 	  do
 	    c = gfc_next_char ();
@@ -600,7 +600,7 @@ next_fixed (void)
 
 blank_line:
   if (digit_flag)
-    gfc_warning ("Statement label in blank line will be ignored at %C");
+    gfc_warning ("Ignoring statement label in empty statement at %C");
   gfc_advance_line ();
   return ST_NONE;
 }
--- gcc-4.2/gcc/testsuite/gfortran.dg/label_1.f90	(revision 112214)
+++ gcc-4.2/gcc/testsuite/gfortran.dg/label_1.f90	(working copy)
@@ -3,7 +3,7 @@
 
 program a
 0056780 continue    ! { dg-error "Too many digits" }
-0 continue          ! { dg-error "Statement label at" }
+0 continue          ! { dg-error "Zero is not a valid statement label" }
   stop 001234       ! { dg-error "Too many digits" }
 end program a
 


More information about the Fortran mailing list