Search code examples
warningscompilationfortrangfortransuppress

Ifort suppress unused variable warning, leave all others intact


i use ifort and gfortran to compile my Fortran program.

However i also use a coworkers source and he has got a lot of unused variables. How can i suppress these for the compile, seeing as they are not really an error?

However i dont want to disable -pedantic and -stan in the compiler options and thus want all the other warnings.

cheers and thanks for the help


Solution

  • With ifort try -warn [no]unused.

    And, while I'm here, I suggest you remove unused variables. The compiler may not regard them as an error, but disciplined software engineering regards all dead and unused code as erroneous; it imposes a maintenance burden.