Re: strict aliasing (was: const correctness) - Mailing list pgsql-hackers

From Andres Freund
Subject Re: strict aliasing (was: const correctness)
Date
Msg-id 201111150033.13627.andres@anarazel.de
Whole thread Raw
In response to Re: strict aliasing (was: const correctness)  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: strict aliasing
List pgsql-hackers
On Monday, November 14, 2011 10:22:52 PM Tom Lane wrote:
> "Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
> >> Tom Lane <tgl@sss.pgh.pa.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


pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: strict aliasing (was: const correctness)
Next
From: Josh Kupershmidt
Date:
Subject: Re: proposal: psql concise mode