This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Moving to AMD64 bit and porting issues
- From: "Ernest L. Williams Jr." <ernesto at ornl dot gov>
- To: "Alex J. Dam" <alexjdam at gmail dot com>
- Cc: GCC-Help <gcc-help at gcc dot gnu dot org>
- Date: Mon, 24 Oct 2005 06:37:51 -0400
- Subject: Re: Moving to AMD64 bit and porting issues
- References: <1129958772.5288.22.camel@lion> <20051024102542.GA3154@hymen>
- Reply-to: ernesto at ornl dot gov
On Mon, 2005-10-24 at 08:25 -0200, Alex J. Dam wrote:
> On Sat, Oct 22, 2005 at 01:26:12AM -0400, Ernest L. Williams Jr. wrote:
> > Should we use "NULL" to represent a null pointer or "0" to represent a
> > null pointer?
>
> AFAIK, according to C++, they are equivalent. See, for example,
>
> http://www.research.att.com/~bs/bs_faq2.html#null
Well, then what we are experiencing:
0 is an int and most likely 32 bits,
NULL is a pointer and 64 bits in the 64-bit architecture.
This then must be the problem, which makes using 0 to represent a NULL
pointer not portable? Or would this be considered a bug with GCC for a
64-bit environment?
Thanks,
Ernesto