[PATCH, Fortran] Allow warnings given through gfc_error to associate with warning flags

Jerry DeLisle jvdelisle@charter.net
Tue Nov 1 19:13:00 GMT 2016


On 11/01/2016 08:10 AM, Fritz Reese wrote:
> All,
>
> Currently warnings given by the GNU Fortran front-end typically
> indicate which flag controls the warning, if any, as given by the
> first argument to gfc_warning. However, there is no support for
> controlling warnings which are emitted by gfc_error when
> warnings_not_errors is set. Herein I propose a patch such that when a
> call to gfc_error may cause a warning, suppression of the warning can
> be controlled with a -W* warning flag, as with other warnings.
>
> The simple patch extends the gfc_error interface to also accept an
> additional 'opt' arg, which is passed as the same first argument to
> gfc_warning if warnings_not_errors causes a warning instead of an
> error. The old interface remains, so that a default 'opt' of 0 is
> passed when gfc_error is called with no 'opt' argument. This minimizes
> the impact of the interface change on existing code. Note also that if
> the call to gfc_error would actually cause an error, the warning flag
> will not suppress the error.
>
> See the patch for details. Bootstraps and regtests on x86_64-redhat-linux.
>
> Another patch proposal will follow which utilizes this functionality
> to introduce a new warning -W[no-]argument-mismatch, assuming this one
> is OK.
>

I think this is OK.

On your second submission after this one, is there something missing?

Jerry



More information about the Fortran mailing list