Re: Using unused variables
- From: Gordon Sande <g.sande@xxxxxxxxxxxxxxxx>
- Date: Mon, 12 Mar 2007 13:01:47 GMT
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
.
- References:
- Using unused variables
- From: Daniel Franke
- Re: Using unused variables
- From: highegg
- Re: Using unused variables
- From: Daniel Franke
- Using unused variables
- Prev by Date: Re: Merits of fortran
- Next by Date: Re: using blank common as malloc on Cray Fortran
- Previous by thread: Re: Using unused variables
- Next by thread: Re: Using unused variables
- Index(es):
Relevant Pages
|
|