Unused variables in Fortran programs
Gordon Sande
g.sande@worldnet.att.net
Mon Jan 3 20:30:00 GMT 2005
Erik Schnetter wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Is there a way to make gfortran not warn about certain unused variables
> when -Wunused is used? I am looking for the equivalent of
> __attribute__((unused)) for some automatically generated parts of
> Fortran code.
>
> Do you know how other Fortran compilers do this? Do they maybe offer
> some special comments, as in
>
> integer i
> ! unused i
You could always try
common / otherwise_unused_vars / i
integer i
depending on how effective the checking is. A useful variant would be
that if NO variable in the common is used then the common should get
the citation for being unused. That would make this trick useless as
it is just exploiting a flaw in the usage analysis.
> - -erik
>
> - --
> Erik Schnetter <schnetter@aei.mpg.de> http://www.aei.mpg.de/~eschnett/
>
> My email is as private as my paper mail. I therefore support encrypting
> and signing email messages. Get my PGP key from www.keyserver.net.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.4 (GNU/Linux)
>
> iD8DBQFB2aVEm3uiSwno3f0RAqvdAJ9fCSfVeaGlmb4qutOC27fe1pz9AQCeP5O9
> QgaJpXg+pIVXnXUuvgSUY2Y=
> =qbv6
> -----END PGP SIGNATURE-----
>
>
More information about the Fortran
mailing list