delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/03/26/21:01:08

Date: Thu, 26 Mar 1998 17:57:31 -0800 (PST)
Message-Id: <199803270157.RAA02235@adit.ap.net>
Mime-Version: 1.0
To: Morten Welinder <terra AT diku DOT dk>, djgpp-workers AT delorie DOT com
From: Nate Eldredge <eldredge AT ap DOT net>
Subject: Re: NULL redefined! :(

At 02:50  3/26/1998 +0100, Morten Welinder wrote:
>
>__null was introduced by the EGCS people because...
>
>1. "0" doesn't work well on machine for which
>    sizeof (int) != sizeof (void *).
>2. "0L" has similar problems.

Just curious, but how do they make it work in plain C? IIRC `int *foo = 0'
is valid ANSI C, and machines with different pointer sizes just have to
figure it out somehow. I assume the compiler can handle a value of 0 being
used as a pointer and act accordingly? In that case, why does that solution
not work for C++?

Nate Eldredge
eldredge AT ap DOT net



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019