This is the mail archive of the gcc@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]

C++ feature request: cast from void * warning


Is this the right address for feature requests?  If so, I'd like to
make a relatively simple feature request for a flag called something
like -Wcast-from-void-pointer / -Wno-cast-from-void-pointer that can
turn on and off the following warning:

warning: ANSI C++ forbids implicit conversion from `void *' in assignment

The warning should obviously be on by default, as implicit casts from
(void *) are incorrect C++ and a bad idea (given features like
multiple inheritence).  However, it would occasionally be nice to
import C code into C++ without, for instance, the need to sanitize
every single call to malloc.  Right now, doing so requires turning off
the -Werror flag, which may result in other more serious warnings
going unnoticed.

This warning might also be useful as an option to the C compiler, for
people attempting to write "clean C".  (Of course, it should be off by
default even with -Wall specified.)

Please CC me on any responses as I am not currently subscribed to the
list.  Thanks.


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