Warning for unadorned 0 in varargs lists?

Paul Koning pkoning@equallogic.com
Mon Aug 23 16:15:00 GMT 2004


>>>>> "Falk" == Falk Hueffner <hueffner@informatik.uni-tuebingen.de> writes:

 Falk> My concern was about differentiating between 0 and NULL. If you
 Falk> care about what works in practise, you should warn about
 Falk> neither; if you care about pedantic standard compliance, you
 Falk> should warn for both.

How can you differentiate 0 from NULL given that NULL is usually
defined as 0?

Yes, there are some people who write (void *)0, but that's generally
considered unnecessary clutter.

The real problem is that C/C++ have a design bug, which is that there
isn't a null pointer token in the language.  Pascal and Algol-68 both
have nil, but that's one item that C++ forgot to copy.

     paul



More information about the Gcc mailing list