Re: ANSI-strict pointer aliasing rules - Mailing list pgsql-hackers

From Tom Lane
Subject Re: ANSI-strict pointer aliasing rules
Date
Msg-id 21138.1146085111@sss.pgh.pa.us
Whole thread Raw
In response to ANSI-strict pointer aliasing rules  (Taral <taralx@gmail.com>)
Responses Re: ANSI-strict pointer aliasing rules
List pgsql-hackers
Taral <taralx@gmail.com> writes:
> I ran afoul of these rules the other day when compiling pgsql 8.1 on
> AIX. The configure scripts are set up to look for "xlc" instead of
> "cc", and that command invokes cc with "-qalias=ansi", the ANSI-strict
> pointer aliasing mode.

We've looked at this before.  There's no way we are buying into the
strict aliasing rules: it's not so much the code we know will break,
as the fear of what we don't know about.  gcc, at least, is utterly
useless about warning about constructs that might change behavior
under strict aliasing ... but without fairly reliable warnings of
such problems, we have little hope of getting all the bugs out.

You'll notice that configure already goes out of its way to force
traditional aliasing for gcc, and I'd recommend doing the same for
AIX's compiler.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Taral
Date:
Subject: ANSI-strict pointer aliasing rules
Next
From: Martijn van Oosterhout
Date:
Subject: Re: ANSI-strict pointer aliasing rules