c++/7354: NULL not defined correctly for g++ 64-bits
craig_files@agilent.com
craig_files@agilent.com
Thu Jul 18 15:16:00 GMT 2002
>Number: 7354
>Category: c++
>Synopsis: NULL not defined correctly for g++ 64-bits
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Jul 18 15:16:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:
>Release: 3.0.2
>Organization:
Agilent Technologies
>Environment:
System: HP-UX lathe B.11.00 A 9000/785 2000978003 two-user license
host: hppa64-hp-hpux11.00
build: hppa64-hp-hpux11.00
target: hppa64-hp-hpux11.00
configured with: ../gcc/configure --prefix=/usr/local/pa20_64 --enable-languages=c,c++ --host=hppa64-hp-hpux11.00 --target=hppa64-hp-hpux11.00 --with-ld=/usr/ccs/bin/ld --with-gnu-as --enable-libstdcxx-v3
>Description:
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.
Thus, NULL's most significant bits are not set to 0 on initialization and
comparing against NULL is not really 0x00000.
>How-To-Repeat:
>Fix:
#define NULL (long int)0 ?
or
#define NULL ((void*)0)
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-prs
mailing list