Re: const correctness

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Florian Pflug <fgp@phlo.org>
Cc: Kevin Grittner <Kevin.Grittner@wicourts.gov>, "Robert Haas" <robertmhaas@gmail.com>, "Thomas Munro" <munro@ip9.org>, pgsql-hackers@postgresql.org
Date: 2011-11-09T22:47:58Z
Lists: pgsql-hackers
Florian Pflug <fgp@phlo.org> writes:
> If we're concerned about helping the compiler produce better code,
> I think we should try to make our code safe under strict aliasing
> rules. AFAIK, that generally helps much more than const-correctness.
> (Dunno how feasible that is, though)

The last time we talked about that, we gave up and added
-fno-strict-aliasing, mainly because nobody trusted gcc to warn us about
violations of the aliasing rules.  That was quite some time ago though.
Perhaps recent gcc versions do better?

			regards, tom lane