Re: fix for strict-alias warnings - Mailing list pgsql-patches

From Tom Lane
Subject Re: fix for strict-alias warnings
Date
Msg-id 15732.1066231467@sss.pgh.pa.us
Whole thread Raw
In response to Re: fix for strict-alias warnings  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-patches
Andrew Dunstan <andrew@dunslane.net> writes:
> All this is interesting, but the real problem remains that we don't know
> what else might be affected because gcc apparently doesn't promise to
> tell us. IMO the gcc team made a bad mistake by turning this on by
> default for -O2 without reliable accompanying diagnostics.

Yeah, this seems to be the killer point.  It *might* be safe to leave
-fstrict-aliasing on; but we can't tell.

I think we can safely just make the default switches for gcc be
CFLAGS="-O2 -fno-strict-aliasing".  If I understand correctly, this will
work with all gcc versions back to 2.7.something, which is pretty much
ancient history now --- and if anyone needs to make it work with such an
old gcc, all they need do is specify CFLAGS to configure instead of
letting it default.

Will commit this change unless I hear objections soon.

            regards, tom lane

pgsql-patches by date:

Previous
From: Neil Conway
Date:
Subject: minor HISTORY improvement
Next
From: Tom Lane
Date:
Subject: Re: fix for strict-alias warnings