🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.misc.discuss
Article #74644

Re: using 0 instead of NULL

#74644
From: Carl Mascott
Date: Sat, 09 Mar 1991 14:22
19 lines
1316 bytes
In article <27D16AC5.3952@maccs.dcss.mcmaster.ca> kevinb@maccs.dcss.mcmaster.ca (Kevin Boyes) writes:
>
>I am very curious why so much of the GNU software that I see
>tests for null pointers with 0 and not NULL.
>...
>Shouldn't NULL be defined to be ((char *)0) if not ((void *)0).
>It is ((void *)0) on my system; QNX using an ANSI?? compiler.

I had a terrible time porting GNU diff to MS-DOS because
0 was used in place of NULL in function calls.  GNU diff
requires a large data model (4-byte pointer).  Pushing
a 2-byte argument on the stack when a 4-byte argument is
expected just doesn't work.  The compiler defines NULL as
(void *) 0, which is always the right size for the memory
model being used.
-- 
Carl Mascott
cmascott@world.std.com
{uunet,xylogics}!world!cmascott
Technical Details
Message-ID: <1991Mar9.142220.23950@world.std.com>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!world!cmascott
References: <27D16AC5.3952@maccs.dcss.mcmaster.ca>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1025b4,343b7ce3977dbb95
X-Google-Attributes: gid1025b4,public
X-Google-ArrivalTime: 1991-03-09 06:41:36 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!world!cmascott
From: cmascott@world.std.com (Carl Mascott)
Newsgroups: gnu.misc.discuss
Subject: Re: using 0 instead of NULL
Message-ID: <1991Mar9.142220.23950@world.std.com>
Date: 9 Mar 91 14:22:20 GMT
References: <27D16AC5.3952@maccs.dcss.mcmaster.ca>
Organization: The World @ Software Tool & Die
Lines: 19