Re: Using unused variables



On 2007-03-12 07:38:33 -0300, Daniel Franke <nospam@xxxxxxxxxxx> said:

highegg wrote:

It is possible that not all init_* routines actually need all N
parameters, nevertheless I would like to pass them in for symmetry
reasons. Thus, I get loads of "unused variable" warnings during compile
(ifort, gfortran). As those parameters are mostly INTENT(IN), one can not
simply "argX = argX" to use them. For clarity of the code, I would like
to avoid to use host association. Adapting the calls to actually pass the
necessary arguments only is tedious. OTOH, the amount of unused-variable
warnings may hide the "real" warnings.

If you're sure you can't solve this using some directives or switches
and can't live with it, a possible solution is to pass them to a
"dumb" subroutine.

Which, then again, gets unused variables reported? =)
At least, I would get reports only once instead of k times ...

Compiler switches that disable reporting of unused variables are out of
question as well as there may be locations where this happened by accident
and indicate a possible error. I want to know those, of course.

Use separate compilation with differing compiler switches.

The is always the the old

if (.false.) then
... <dead code> ...
end if

which may draw dead code diagnostics from aggressive optimizing compilers.

Daniel


.



Relevant Pages

  • Re: Using unused variables
    ... I get loads of "unused variable" warnings during compile ... Which, then again, gets unused variables reported? ... I would get reports only once instead of k times ... ...
    (comp.lang.fortran)
  • RE: Redhat 9.0 development environment wierdness...
    ... It still has the warnings you posted. ... setup depends on you or the project you are trying to compile. ... Redhat 9.0 development environment wierdness... ... need to install on our servers and if I can't even get through these I ...
    (RedHat)
  • Re: does VS C++ 2005 actually work????
    ... may be the same size as a pointer, they have nothing logically to do with ... sizeofand size_t generating warnings when used in the context of API ... I can't compile ... justified criticism regarding the reliability of Windows. ...
    (microsoft.public.vc.mfc)
  • Re: 2.6.23.9-rt13
    ... If I compile -rt13 I get some compile warnings on ARM: ... Both warnings are fixed by the attached patch, but warning 2 needs some review. ... New changes by Steven Rostedt, Gregory Haskins, ... Revert lazy disable irq from simple irq handler ...
    (Linux-Kernel)
  • Re: <ftream> errors under g++ 3.2.2
    ... > gives error messages about implicit typenames being deprecated, ... is nothing you can do to your code to prevent the warnings. ... From your output, I don't see compile failures, I see warnings. ... I am surprised that a GCC header would have an implicit ...
    (freebsd-current)