------- Comment #3 from kargl at gcc dot gnu dot org 2009-07-21 19:49 ------- (In reply to comment #2) > Just to clarify: you might misunderstand this. In Fortran, -Wunused-parameters > is used to issue a warning whenever a constant (which in Fortran called > "PARAMETER") is declared but not used. It has nothing to do with function's > parameters in the usual ("C") sense. >
I'm not misunderstanding. There isn't a -Wunused-parameters option. Notice the 's' at the end. So, asking for the negation of a nonexistent option is questionable. Since you cite gcc documentation, the logical conclusion is that you meant the -Wunused-parameter option. Notice the lack of the 's'. troutmask:sgk[246] cat a.f90 subroutine tests(i) integer i ! Unused argument integer, parameter :: j = 42 ! Unused parameter print *, 'hi' end subroutine tests troutmask:sgk[247] gfc4x -c -Wall a.f90 a.f90:1.18: subroutine tests(i) 1 Warning: Unused dummy argument 'i' at (1) troutmask:sgk[248] gfc4x -c -Wall -Wextra a.f90 a.f90:1.18: subroutine tests(i) 1 Warning: Unused dummy argument 'i' at (1) a.f90:3.26: integer, parameter :: j = 42 1 Warning: Unused parameter 'j' declared at (1) troutmask:sgk[249] gfc4x -c -Wall -Wextra -Wno-unused a.f90 troutmask:sgk[250] gfc4x -c -Wall -Wextra -Wno-unused-parameter a.f90 a.f90:1.18: subroutine tests(i) 1 Warning: Unused dummy argument 'i' at (1) troutmask:sgk[251] gfc4x -c -Wall -Wextra -Wno-unused-parameter -Wno-unused-vari able a.f90 troutmask:sgk[252] AFAICT, the options are workng on trunk. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40820