Package segfaults when built with -O2 but not with -O0

Tom Lane tgl at redhat.com
Fri Nov 18 23:32:28 UTC 2011


Andrew Haley <aph at redhat.com> writes:
> On 11/18/2011 05:53 PM, Ralf Corsepius wrote:
>> pptp.c:459:33: warning: dereferencing type-punned pointer might break 
>> strict-aliasing rules [-Wstrict-aliasing]

> Bingo!  Bugs like this must be fixed.

Sometimes that's easier said than done.  -fno-strict-aliasing might be
your friend.

-fwrapv is another good tool for keeping the compiler from breaking
traditional understandings of C semantics.

			regards, tom lane


More information about the devel mailing list