[patch, fortran] pr21061 - gfortran ignores -Werror

Bernhard Fischer rep.nop@aon.at
Sat Nov 18 13:59:00 GMT 2006


On Tue, Nov 07, 2006 at 01:27:08PM -0800, Brooks Moses wrote:
>Bernhard Fischer wrote:
>>Index: error.c
>>===================================================================
>>--- error.c     (revision 118542)
>>+++ error.c     (working copy)
>>@@ -525,17 +525,18 @@
>>   if (gfc_suppress_error)
>>     return warning ? SUCCESS : FAILURE;
>> 
>>-  cur_error_buffer = (warning && !warnings_are_errors)
>>-    ? &warning_buffer : &error_buffer;
>>+  cur_error_buffer = warning ? &warning_buffer : &error_buffer;
>>   cur_error_buffer->flag = 1;
>>   cur_error_buffer->index = 0;
>> 
>>   if (buffer_flag == 0)
>>     {
>>-      if (warning && !warnings_are_errors)
>>+      if (warning)
>>        warnings++;
>>       else
>>        errors++;
>>+      if (warning && warnings_are_errors)
>>+       errors++;
>>     }
>>   va_start (argp, nocmsgid);
>>   if (warning)
>>
>>
>>Bernhard Fischer  <>
>>	* error.c (gfc_notify_std): Disregard warnings_are_errors when
>>	deciding which logbuffer to use. Also increment warnings if
>>	warnings_are_errors is set.
>>
>>Would that be ok?
>
>It looks ok to me, but I can't approve it.
>
>Also, on going through the list of affected functions in the patch I'm 
>submitting, I noticed that if you're putting warnings in the 
>warning_buffer regardless of warnings_are_errors, then 
>error_warning_check needs to be updated to optionally increment errors.

You already applied this (by adding gfc_increment_error_count), so the
part incrementing the error is already done which leaves reverting the
change i did to put the warnings into the error buffer. I shall re-check
and retest the hunk above now.
>
>>>(In particular, I'm wondering if this has to do with lines 2606-2610 of 
>>>match.c, which implement a gfc_notify_std_now sort of thing assuming 
>>>that if gfc_notify_std has returned FAILURE that the result is in 
>>>error_buffer, or whether there's a more global reason for it...?)
>>
>>The initial reasoning from my part was to use the error buffer even for
>>warnings if Werror was set. This was dropped for the sake of simplicity
>>and since it was not really needed AFAICS.
>>
>>match.c lines 2599-2604 really look like they want gfc_error_now instead
>>of the gfc_error, gfc_error_check combo. Or is there a subtile reason
>>for the combo?
>
>That's how I'd read it, too.  I don't see that the combo does anything.

Noted.

Thanks for your comments,
Bernhard



More information about the Fortran mailing list