public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: Gabriel Dos Reis <gdr@merlin.nerim.net> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, Subject: Re: c++/7354: NULL not defined correctly for g++ 64-bits Date: Thu, 18 Jul 2002 21:46:00 -0000 [thread overview] Message-ID: <20020719044601.25195.qmail@sources.redhat.com> (raw) The following reply was made to PR c++/7354; it has been noted by GNATS. From: Gabriel Dos Reis <gdr@merlin.nerim.net> To: craig_files@agilent.com Cc: gcc-gnats@gcc.gnu.org Subject: Re: c++/7354: NULL not defined correctly for g++ 64-bits Date: 19 Jul 2002 06:41:26 +0200 craig_files@agilent.com writes: [...] | NULL is defined (in stddef.h) for C++ as: | #define NULL 0 | This is a problem in 64-bit world because the 0 is not a long int, but an int. There is no requirement that NULL in C++ should be of type long int. The only thing that is guaranteed is that it is an integral constant expression, the exact type of which is unspecified -- it may legitimately defined as '\0'. Programs depending on NULL being of a particular value are broken. Furthermore, NULL is intended to be used, suitably *converted*, to provide a null pointer. That means that you'd better explicitly convert NULL to the appropriate target (pointer) type when you use it. [...] | #define NULL ((void*)0) This can't be. -- Gaby
next reply other threads:[~2002-07-19 4:46 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2002-07-18 21:46 Gabriel Dos Reis [this message] -- strict thread matches above, loose matches on Subject: below -- 2002-07-20 9:08 lerdsuwa 2002-07-18 15:16 craig_files
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20020719044601.25195.qmail@sources.redhat.com \ --to=gdr@merlin.nerim.net \ --cc=gcc-prs@gcc.gnu.org \ --cc=nobody@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).