This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: No NULL in 3.0.2???
- To: JDonner <jdonner0 at earthlink dot net>
- Subject: Re: No NULL in 3.0.2???
- From: bley at wh2-19 dot st dot uni-magdeburg dot de (Claudio Bley)
- Date: Tue, 30 Oct 2001 20:37:23 +0100
- Cc: gcc-help at gcc dot gnu dot org
- References: <3BDED27C.9090909@earthlink.net>
>>>>> "JDonner" == JDonner <jdonner0@earthlink.net> writes:
JDonner> Hi, This:
JDonner> int main(int argc, char** argv) { int* p = NULL; }
JDonner> produces this:
JDonner> null.cpp: In function `int main(int, char**)':
JDonner> null.cpp:3: `NULL' undeclared (first use this function)
JDonner> null.cpp:3: (Each undeclared identifier is reported only
JDonner> once for each function it appears in.)
JDonner> Isn't NULL still part of the standard? I can't believe
JDonner> it'd be deprecated. I'm sure there are still a lot of
JDonner> people who use NULL.
JDonner> If NULL _is_ slated for eventual removal, I think it's
JDonner> still very much alive right now.
NULL never was in the C++ standard - it is a C invention and in fact,
Bjarne Stroustrup (the "inventor" of C++) strongly discourages its use
in his book "The C++ Programming Language". If programming in C++ you
should really prefer '0' over the preprocessor variable 'NULL'.
Claudio