Re: const correctness

Kevin Grittner <kevin.grittner@wicourts.gov>

From: "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
To: "Tom Lane" <tgl@sss.pgh.pa.us>
Cc: "Peter Geoghegan" <peter@2ndquadrant.com>, "Peter Eisentraut" <peter_e@gmx.net>, "Thomas Munro" <munro@ip9.org>,<pgsql-hackers@postgresql.org>
Date: 2011-11-10T20:24:48Z
Lists: pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> wrote:
 
> The problem with it of course is that mistaken use could have the
> effect of casting-away-const, which is exactly what we hoped to
> prevent.  Still, there may not be a better solution.
 
Yeah, I've come to the conclusion that the compiler doesn't do the
apparently-available optimizations using const precisely because it
is so easy to cast away the property maliciously or accidentally.
 
-Kevin