This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] unify free- and fixed-form diagnostic messages
- From: Bernhard Fischer <rep dot nop at aon dot at>
- To: Jerry DeLisle <jvdelisle at verizon dot net>
- Cc: fortran at gcc dot gnu dot org, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 18 Apr 2006 19:18:09 +0200
- Subject: Re: [patch] unify free- and fixed-form diagnostic messages
- References: <20060321170323.GB5394@aon.at> <4420D5AA.4090905@verizon.net> <20060322111759.GB30503@aon.at>
On Wed, Mar 22, 2006 at 12:17:59PM +0100, Bernhard Fischer wrote:
>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.
Regression-tested on i686-pc-linux-gnu with no regressions.
OK for trunk?
>--- 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
>