This is the mail archive of the mailing list for the GCC 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


:ADDPATCH fortran:

Attached is a revised and much simpler fix for PR fortran/21061 where
-Werror was ignored. The attached patch makes sure that we exit(1)
properly even for warnings.

It expects the improved error message that will be eventually
introduced to fix pr27698. It comes with two testcases, on for free- and
one for fixed format. The free format testcase trips one other bug that
is diagnostic related: fortran/trans-decl.c incorrectly uses
warning(0,...) instead of the gfc versions thereof ¹), but that is a
different issue.
Finally, i didn't see how to check for the proper return code (1 if
warnings/errors were seen and -Werror was given) in dg-do compile tests,
so the proper return value is not currently checked.

2006-09-14  Bernhard Fischer  <>

	PR fortran/21061
	* error.c (gfc_warning): If warnings_are_errors then treat
	warnings as errors with respect to the exit code.
	(gfc_notify_std): Ditto.
	(gfc_warning_now): Ditto.

2006-09-14  Bernhard Fischer  <>

	PR fortran/21061
	* gfortran.dg/warnings_are_errors.f: New test.
	* gfortran.dg/warnings_are_errors.f90: New test.

       function char_ (ch) ! { dg-warning "is obsolescent in fortran 95" }
       character(*) :: char_, ch
! warning(0,...):
       write (*,*) ch ! { dg-warning "Function does not return a value" }
       end function char_


On Wed, Sep 13, 2006 at 02:04:19PM -0700, Steve Kargl wrote:
>On Wed, Jul 05, 2006 at 09:27:20PM +0200, Bernhard Fischer wrote:
>> 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
>I'll try to get a review of the patch out to you on Saturday.
>OTOH, if someone else has time to provide feedback, I'm sure
>Bernhard would not mind an earlier review.

Attachment: gcc.gfortran.pr21061.3a.diff
Description: Text document

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