Subject: Re: toolchain/22118: make won't compile with -Wcast-qual -Wstrict-prototypes and more
To: Simon J. Gerraty <sjg@crufty.net>
From: Greg A. Woods <woods@weird.com>
List: tech-toolchain
Date: 07/14/2003 13:25:31
[ On Monday, July 14, 2003 at 08:53:57 (-0700), Simon J. Gerraty wrote: ]
> Subject: Re: toolchain/22118: make won't compile with -Wcast-qual -Wstrict-prototypes and more
>
> But eventually you find youself needing to do free(DECONST(pointer))
> at which point it all starts to seem silly ;-)
Obviously you can no more free const-qualified storage than you can
ignore its const qualifier and pass it to a function which might try to
modify or free it.
If a pointer passed to free() may ever have been derived from a string
constant then there's a very nasty bug lurking somewhere.
--
Greg A. Woods
+1 416 218-0098 VE3TCP RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com> Secrets of the Weird <woods@weird.com>