This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: -Wunused and argument lists
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: "David C. Thompson" <dcthomp at sandia dot gov>
- Cc: fortran at gcc dot gnu dot org
- Date: Tue, 4 Oct 2005 13:04:29 -0700
- Subject: Re: -Wunused and argument lists
- References: <1128454819.8303.4481.camel@fozzy.ran.sandia.gov>
On Tue, Oct 04, 2005 at 12:40:19PM -0700, David C. Thompson wrote:
> Hi,
>
> I'm trying to get warning-free compiles of some old F77 code using
> gfortran (a gcc compiled from CVS at hpc.sourceforge.net, dated Sep.
> '05), but I am having trouble with -Wunused; I have some functions where
> not all the arguments are used, but those arguments must still be passed
> because a library requires the argument list as given. For example:
>
> REAL*8 FUNCTION f(a,b)
> IMPLICIT NONE
> INTEGER*4 a,b
> F = 7.7d1*a
> END
>
> will get a warning about "b" being unused, but I am not free to remove
> "b" from the argument list. In C, I would just use
>
I don't know if logical is getting inverted, but
troutmask:kargl[36] cat > lo.f
REAL*8 FUNCTION f(a,b)
IMPLICIT NONE
INTEGER*4 a,b
F = 7.7d1*a
END
troutmask:kargl[37] gfc -Wunused -c lo.f
lo.f: In function 'f':
lo.f:1: warning: unused variable 'b'
troutmask:kargl[38] gfc -Wno-unused -c lo.f
troutmask:kargl[39]
-Wunused == report unused variables
-Wno-unused == do not report unused variables.
--
Steve