Re: fix for strict-alias warnings

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: fix for strict-alias warnings
Date: 2003-10-15 15:24:27
Message-ID: 15732.1066231467@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Andrew Dunstan <andrew(at)dunslane(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2003-10-15 15:32:07 pg_dump doesn't dump conversions?
Previous Message Fernando Nasser 2003-10-15 15:22:06 Re: postgres --help-config

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2003-10-15 15:49:17 Re: fix for strict-alias warnings
Previous Message Neil Conway 2003-10-15 15:01:36 minor HISTORY improvement