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: useful debug flags?


Tom Roche wrote:
The fortran guru in my group (which seems quite ifort-oriented) proposed
the following flags as being "generally useful" when debugging.
(gcc flags would probably be useful too, but were not proposed.) I'm
wondering if any were missed (conversely, if any listed are deprecated):

gfort: -fimplicit-none -frange-check -Wall -Wunderflow -Werror -ffpe-trap=invalid,zero,overflow,underflow,precision,denormal -fbounds-check -g

You might also try -Wextra which gives some extra warnings, which might or might not be useful.


-fcheck=all gives some more run-time diagnostic.

The -finit* allow to initialize variables with bogus values, which can help to find uninitialized values at run time; especially -finit-real=snan with -ffpe-trap=invalid. (On the other hand, it might disable some compile-time warnings about undefined or unused variables.)

)Regarding the latter: With optimization (-O) some more uninitialized/unused variables might be found.)

See manual: http://gcc.gnu.org/onlinedocs/gfortran/Invoking-GNU-Fortran.html

Tobias


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