Can I limit where -ffpe-trap=zero is applied?

Ken Mankoff mankoff@gmail.com
Wed Aug 2 14:19:22 GMT 2023


Hi List,

I'm compiling a program with, among other things, 

-ffpe-trap=invalid,zero,overflow

In order to catch divide-by-zero issues. However, this causes it to crash in a much lower level library than I want to worry about at this point.

It's crashing due to a divide-by-zero error in the Blitz C++ array library. That library is several dependencies deep, and was compiled with

CFLAGS="-fPIC -DNDEBUG" FCFLAGS="-fPIC -DNDEBUG" CPPFLAGS="-fPIC -DNDEBUG" cmake ..

I hoped the '-DNDEBUG' would allow Blitz to ignore the fpe-trap=zero but it does not seem to.

Thanks,

  -k.



More information about the Gcc-help mailing list