[PATCH, Fortran] New warning flag -Wargument-mismatch to control argument mismatch warnings
Jerry DeLisle
jvdelisle@charter.net
Tue Nov 1 23:18:00 GMT 2016
On 11/01/2016 12:38 PM, Fritz Reese wrote:
> See attached.......
>
Good to go.
> ---
> Fritz Reese
>
>
> On Tue, Nov 1, 2016 at 11:24 AM, Fritz Reese <fritzoreese@gmail.com> wrote:
>> All,
>>
>> Here I propose a new warning flag -Wargument-mismatch to control
>> warnings emitted when the type, rank, or some other property of actual
>> arguments does not match that of a function's formal parameters
>> according to its declaration or interface specification. The warnings
>> are of course enabled by default, as they should be. Note also with
>> -Wno-argument-mismatch, only _warnings_ are suppressed. In such cases
>> where an argument mismatch is an error, the error is still properly
>> emitted.
>>
>> This simple patch depends on the recently-submitted patch [1] "Allow
>> warnings given through gfc_error to associate with warning flags".
>> Since the argument mismatch warnings are sometimes errors, they are
>> currently emitted through gfc_error with `warnings_not_errors` set.
>> Without the solution in [1], awkward code changes may be required to
>> work around this fact.
>>
>> The new flag is supplied for the benefit of those users which believe
>> that suppression of any given warning generated by a compiler should
>> be possible. Such users may be frustrated with the current GNU Fortran
>> front-end, in which there is no way to suppress this class of
>> warnings, even if the user "knows what he is doing" and refuses to
>> change his/her code.
>>
>> [1] https://gcc.gnu.org/ml/fortran/2016-11/msg00003.html
>>
>> Bootstraps and regtests on x86_64-redhat-linux.
>>
>> if (gfc_accepted ([1]))
>> {
>> gfc_ask_ok_for_trunk ($0);
>> }
>>
>> ---
>> Fritz Reese
More information about the Fortran
mailing list