From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25218 invoked by alias); 19 Jul 2002 04:46:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 25196 invoked by uid 71); 19 Jul 2002 04:46:01 -0000 Date: Thu, 18 Jul 2002 21:46:00 -0000 Message-ID: <20020719044601.25195.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Gabriel Dos Reis Subject: Re: c++/7354: NULL not defined correctly for g++ 64-bits Reply-To: Gabriel Dos Reis X-SW-Source: 2002-07/txt/msg00560.txt.bz2 List-Id: The following reply was made to PR c++/7354; it has been noted by GNATS. From: Gabriel Dos Reis 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