[gcc-in-cxx] Add a couple of CONST_CAST uses

Ian Lance Taylor iant@google.com
Thu Feb 5 08:04:00 GMT 2009


In C++, if you want to add const to a T** pointer, you should use
const_cast.  Otherwise, g++ will issue a warning which -Werror will
turn into an error.  I committed this patch to gcc-in-cxx branch to
use CONST_CAST in a couple of cases to avoid this warning.

Ian


2009-02-04  Ian Lance Taylor  <iant@google.com>

	* main.c (main): Use CONST_CAST when adding potentially unsafe
	const.
	* attribs.c (init_attributes): Change slot to void** and use
	CONST_CAST when assigning to it.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.patch
Type: text/x-patch
Size: 1127 bytes
Desc: Add CONST_CAST
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20090205/0337bd5b/attachment.bin>


More information about the Gcc-patches mailing list