[patch, fortran] PR38407 - add -W[no-]unused-dummy-argument

Tobias Burnus burnus@net-b.de
Thu May 20 17:45:00 GMT 2010


On 05/20/2010 06:24 PM, Daniel Franke wrote:
> Attached patch seperates warnings for unused variables and unused dummy 
> arguments.
>   

Observation - not yet a review.

Currently, there will always be a warning if one does not set an
INTENT(OUT) dummy argument (and be it by default initialization). About
other dummy arguments, one only warns with -Wunused-variable.

With the patch, -Wuniused-dummy-argument is used for both - INTENT(OUT)
and other dummy arguments.

I am not sure whether I like the change; it is nice that one can turn
off the warning. However, not setting INTENT(OUT) variables indicates an
logical error in the program while not setting/reading a variable can
have other reasons (e.g. backward compatibility - especially as gfortran
does not have "__attribute__((unused))"). I would like to see the
warnings be split, e.g. by keeping the default warning (even though one
cannot turn it off then).

Tobias



More information about the Gcc-patches mailing list