Re: ANSI-strict pointer aliasing rules

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Taral <taralx(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: ANSI-strict pointer aliasing rules
Date: 2006-04-26 20:58:31
Message-ID: 21138.1146085111@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Taral <taralx(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-04-26 21:01:51 Re: ANSI-strict pointer aliasing rules
Previous Message Bruce Momjian 2006-04-26 20:45:48 Re: [HACKERS] Enhanced containment selectivity function