[Bug fortran/52789] New: gfortran sets -Wunused-parameter in the C sense as well as the Fortran sense
mathewc at nag dot co.uk
gcc-bugzilla@gcc.gnu.org
Fri Mar 30 14:31:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52789
Bug #: 52789
Summary: gfortran sets -Wunused-parameter in the C sense as
well as the Fortran sense
Classification: Unclassified
Product: gcc
Version: 4.6.3
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: mathewc@nag.co.uk
I'm using
$ uname -a
Linux stonehenge 3.3.0-4.fc16.x86_64 #1 SMP Tue Mar 20 18:05:40 UTC 2012 x86_64
x86_64 x86_64 GNU/Linux
$ gfortran --version
GNU Fortran (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2)
and with
$ cat unused.f90
subroutine s(x)
integer, parameter :: i = 0
end
I get
$ gfortran -Wunused-parameter -c unused.f90
unused.f90:2.23:
integer, parameter :: i = 0
1
Warning: Unused parameter 'i' declared at (1)
unused.f90:1:0: warning: unused parameter ‘x’ [-Wunused-parameter]
I think the C warning used to be suppressed at 4.5(?).
Specifying -Wunused-dummy-argument gets rid of the C message:
$ gfortran -Wunused-parameter -Wunused-dummy-argument -c unused.f90
unused.f90:2.23:
integer, parameter :: i = 0
1
Warning: Unused parameter 'i' declared at (1)
unused.f90:1.14:
subroutine s(x)
1
Warning: Unused dummy argument 'x' at (1)
More information about the Gcc-bugs
mailing list