This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: No unused constant warnings


Terry Frankcombe wrote:
Is there any particular reason that using -Wunused with gfortran 4.2
(prerelease 20070228) produces warnings for declared, unused variables,
but not for declared, unused constants (with the parameter attribute)?

From a fairly quick look through the source code, it appears that the warning in question is produced when a local-variable declaration is generated, in the part of the code that produces a language-independent representation to be passed along to the GCC optimizers and backends.


At that point, parameters and constants have generally already been folded in and so forth, and so (as far as I know) there isn't really a comparable place in the code to put in a parallel check for them.

- Brooks


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]