views:

41

answers:

2

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

+1  A: 

With ifort try -warn [no]unused. With gfortran, why the heck would you use gfortran when you have Intel Fortran ?

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.

High Performance Mark
A: 

Yes, as High Performance Mark pointed out, the best way to get rid of those warnings is to tell your coworker to fix his code.

As for easy solutions, with gfortran, have a look at the -Wunused-### options in gcc's manual: Warning Options. Notably, -Wno-unused-variable might do what you want.

[...] why the heck would you use gfortran when you have Intel Fortran ?

When developing, running your code through multiple compilers helps in finding bugs and producing portable code.

eriktous

related questions