[d2n-analysis-talk] fortran bounds check
Brad Sawatzky
brads at jlab.org
Thu Nov 29 16:16:26 EST 2012
Oh yeah. The other scary bug in old code is associated with
uninitialized variables. Older versions of fortran automagically
initialized variables to zero -- I've run across old code that relied on
this informal behaviour. As you might imagine, this can result in some
weird indeterminate bugs on compilers that don't initialize by default
(ie. all GNU compilers). The code execution can depend on whatever
happened to be in in a given block of memory at allocation time.
It is wise to make sure the "-finit-local-zero" flag is used (which can
cause a performance hit), and/or use "-Wall" which should flag variables
that get used without explicit initialization.
-- Brad
On Thu, 29 Nov 2012, Brad Sawatzky wrote:
> GNU (gfortran 4.1.2) -fbounds-check
>
--
Brad Sawatzky, PhD <brads at jlab.org> -<>- Jefferson Lab / Hall C / C111
Ph: 757-269-5947 -<>- Fax: 757-269-5235 -<>- Pager: brads-page at jlab.org
The most exciting phrase to hear in science, the one that heralds new
discoveries, is not "Eureka!" but "That's funny..." -- Isaac Asimov
More information about the d2n-analysis-talk
mailing list