This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [patch, fortran] pr21061 - gfortran ignores -Werror
- From: Bernhard Fischer <rep dot nop at aon dot at>
- To: fortran at gcc dot gnu dot org
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 21 Apr 2006 09:58:29 +0200
- Subject: Re: [patch, fortran] pr21061 - gfortran ignores -Werror
- References: <20060321185018.GC5394@aon.at>
On Tue, Mar 21, 2006 at 07:50:19PM +0100, Bernhard Fischer wrote:
>Hi,
>
>The attached patch fixes fortran/pr21061.
>Please test and review.
>
>I'm aware of the following problems with the testcases:
>
>Some checks do fail, perhaps because the repeat the same output?
>FAIL: gfortran.dg/warnings_are_errors_1.f -O (test for errors, line 13)
>FAIL: gfortran.dg/warnings_are_errors_1.f -O (test for errors, line 14)
>FAIL: gfortran.dg/warnings_are_errors_1.f -O (test for errors, line 16)
>FAIL: gfortran.dg/warnings_are_errors_1.f -O (test for errors, line 17)
I am still not clear about the reason why these fail, so i'd be glad if
somebody could give me a hint on these.
>
>This one ignores -Werror since it uses the warning(0,...) function instead
>of the gfc_() ones:
>FAIL: gfortran.dg/warnings_are_errors_1.f90 -O (test for errors, line 11)
>FAIL: gfortran.dg/warnings_are_errors_1.f90 -O (test for excess errors)
We can of course avoid to stress these until they are converted to their
gfc_() counterparts (i.e. drop them for now). Not sure if this test
should be kept as a reminder.
>
>I'd be glad for hints on how to adjust the testcases to produce the
>expected results proper.
>
>Ok for trunk after the testcases are fixed?
One other thing i noticed is that the patch did emit the string "error"
instead of "warning" which did seem correct to me when i wrote the
patch, but is not what the C frontend does. In C, the string for
warnings emitted with -Werror still is "warning" and not "error".
Should fortran, too, retain printing a warning but count the warning as
error or is printing a warning as "error" for -Werror fine?
>
>2006-03-21 Bernhard Fischer <aldot@gcc.gnu.org>
>
> PR fortran/21061
> * error.c (gfc_warning): Rename to _gfc_warning.
> (gfc_warning_now): Rename to _gfc_warning_now.
> (gfc_error): Rename to _gfc_error.
> (gfc_error_now): Rename to _gfc_error_now.
> (gfc_warning): Call _gfc_warning or _gfc_error depending on
> warnings_are_errors.
> (gfc_warning_now): Likewise.
> (gfc_notify_std): Likewise.
>
>
>2006-03-21 Bernhard Fischer <aldot@gcc.gnu.org>
>
> PR fortran/21061
> * warnings_are_errors_1.f: New testcase.
> * warnings_are_errors_1.f90: New testcase.
>
>
>PS: re http://gcc.gnu.org/ml/fortran/2005-11/msg00730.html
>I'm curious as to if there is consensus that we should use the generic
>warning/error handling used throughout the rest of gcc. Personally i
>like gfortran's attempt to point to the correct locus, as opposed to the
>terse information e.g. the C frontend is giving with respect to the
>column an error did occur.
>
[snip patch]