This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch, fortran] pr21061 - gfortran ignores -Werror


On Fri, Apr 21, 2006 at 09:58:29AM +0200, Bernhard Fischer wrote:
>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?

Steve Kargl suggested a while ago that i'd resend the current
incarnation so he or somebody else could have a look.

Attached patch is against current trunk and emits the string 'error'
instead of 'warnings are treated as errors' once and then the usual
'warning'/'error' string like the C frontend does.

thanks for suggestions WRT the string and the excess errors in the
testcases,
Bernhard

>>
>>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.
>>

Attachment: gcc.gfortran.pr21061.2.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]