Obscure crashes due to gcc 4.9 -O2 => -fisolate-erroneous-paths-dereference
Jeff Prothero
jprother@altera.com
Fri Feb 20 01:04:00 GMT 2015
(Thanks to everyone for the helpful feedback!)
Daniel Gutson wrote:
> what about then two warnings (disabled by default), one intended to
> tell the user each time the compiler removes a conditional
> (-fdelete-null-pointer-checks)
> and another intended to tell the user each time the compiler adds a
> trap due to dereference an address 0?
>
> E.g.
> -Wnull-pointer-check-deleted
> -Wnull-dereference-considered-erroneous
I very much like the idea of such warnings.
I'm not clear why one would not warn by default when detecting
non-standards-conformant code and producing code guaranteed not
to do what the programmer intended. But presumably most sane
engineers these days compile with -Wall. :-)
-Jeff
More information about the Gcc
mailing list