public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* No NULL in 3.0.2???
@ 2001-10-30  8:26 JDonner
  2001-10-30 11:36 ` Claudio Bley
  0 siblings, 1 reply; 2+ messages in thread
From: JDonner @ 2001-10-30  8:26 UTC (permalink / raw)
  To: gcc-help

Hi,

   This:

int main(int argc, char** argv)
{
   int* p = NULL;
}

produces this:

null.cpp: In function `int main(int, char**)':
null.cpp:3: `NULL' undeclared (first use this function)
null.cpp:3: (Each undeclared identifier is reported only once for each 
function
    it appears in.)

Isn't NULL still part of the standard?  I can't believe it'd be 
deprecated.  I'm sure there are still a lot of people who use NULL.

If NULL _is_ slated for eventual removal, I think it's still
very much alive right now.

gcc -v
Reading specs from 
/usr/local/gcc302/lib/gcc-lib/i686-pc-linux-gnu/3.0.2/specs
Configured with: /home/jdonner/mk302/gcc-3.0.2/configure 
--enable-threads=posix --prefix=/usr/local/gcc302
Thread model: posix
gcc version 3.0.2

Jeff

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: No NULL in 3.0.2???
  2001-10-30  8:26 No NULL in 3.0.2??? JDonner
@ 2001-10-30 11:36 ` Claudio Bley
  0 siblings, 0 replies; 2+ messages in thread
From: Claudio Bley @ 2001-10-30 11:36 UTC (permalink / raw)
  To: JDonner; +Cc: gcc-help

>>>>> "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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-10-30 11:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-30  8:26 No NULL in 3.0.2??? JDonner
2001-10-30 11:36 ` Claudio Bley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).