Re: strict aliasing (was: const correctness)

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>, "Robert Haas" <robertmhaas(at)gmail(dot)com>, "Thomas Munro" <munro(at)ip9(dot)org>, "Florian Pflug" <fgp(at)phlo(dot)org>
Subject: Re: strict aliasing (was: const correctness)
Date: 2011-11-14 23:33:13
Message-ID: 201111150033.13627.andres@anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Monday, November 14, 2011 10:22:52 PM Tom Lane wrote:
> "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov> writes:
> >> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >>> Dunno ... where were the warnings exactly?
> >
> > From HEAD checkout of a few minutes ago I now see only 9:
> Hmm ... well, none of those look likely to be in performance-sensitive
> areas. But I wonder just how good the trouble-detection code is these
> days.
No idea about how good it is but you can make the detection code more
aggressive by -Wstrict-aliasing=1 (which will produce more false positives).

I don't gcc will ever be able to call all possible misusages. E.g. The List
api is a case where its basically impossible to catch everything (as gcc won't
be able to figure out what the ListCell.data.ptr_value pointed to originally
in the general case).

Andres

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Kupershmidt 2011-11-14 23:43:03 Re: proposal: psql concise mode
Previous Message Andres Freund 2011-11-14 23:28:02 Re: strict aliasing (was: const correctness)