Page 1 of 1

"bounds-checking" should be "bounds-check"

Posted: Wed Jan 05, 2011 3:14 pm
by jzwanzig
Here is an issue in both 6.4.3 and 6.5.2, I can work around it but don't know exactly the best file(s) to fix it in:

the debug "naughty" option for gnu adds the flag "-fbounds-checking" but at least on my gcc/gfortran this is the wrong syntax, it should be "-fbounds-check". As far as I can tell this is set in three files:
config/debug/{fc,cc}_gnu_default-debug.conf
config/m4/auto-debug.m4

I guess all of these need to be changed but I would like Yann or another expert to verify.

BTW why does this option have to be called "naughty"? I am totally aware that lately I have no sense of humor about these things, but while I can live with (and smile about) "paranoid", "naughty" just seems weird. I don't think I'm breaking any rules by using bounds checking as part of the debug process.

Grimly yours,
Joe

Re: "bounds-checking" should be "bounds-check"

Posted: Wed Jan 05, 2011 4:23 pm
by pouillon
You're right. Looks like -fbounds-checking was correct up to GCC 4.2 only. You should then update config/debug/{fc,cc}_gnu_default-debug.conf, which will allow for the regeneration of config/m4/auto-debug.m4. The latter should not be edited, as it is overwritten each time you run makemake (hence the "auto-" prefix).

The choice of "naughty" as level name comes from that using this option was breaking the build on most architectures when we started to practice this kind of debugging. And it might still do so. ;-)

Re: "bounds-checking" should be "bounds-check"

Posted: Wed Jan 05, 2011 4:29 pm
by jzwanzig
Thanks, Yann. Does this mean that additional options need to be added to check for which version of gcc/gfortran is in use, to make the code more portable?

Re: "bounds-checking" should be "bounds-check"

Posted: Wed Jan 05, 2011 5:21 pm
by pouillon
You could indeed copy the files into *_gnu_4.2-debug.conf before changing the flags.

Re: "bounds-checking" should be "bounds-check"  [SOLVED]

Posted: Fri Jan 07, 2011 12:33 pm
by jzwanzig
All done in my 6.5.2-public branch, which last night passed all tests.