This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Warning patch installed


* Kaveh R. Ghazi (ghazi@caip.rutgers.edu) [20000504 20:48]:

> IMO, -Wcast-qual is not broken.  It correctly warns when you cast away
> the const-ness of a pointer.  E.g. "const char *foo; free((char *)foo);"

What we'd need would be something like const_cast in C++. This would allow
making it explicit what is being tried to achieve. I just hope that
something like that will be added to the next C standard. I at least would
love to have it. And no, I'm not proposing to add this as a GCC extension
because of the troubles these have caused and still are causing.

Philipp

-- 
Philipp Thomas <pthomas@suse.de>
Development, SuSE GmbH, Schanzaecker Str. 10, D-90443 Nuremberg, Germany

#define NINODE  50              /* number of in core inodes */
#define NPROC   30              /* max number of processes */
 	-- Version 7 UNIX fuer PDP 11, /usr/include/sys/param.h

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]