🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.misc.discuss
Article #74739

using 0 instead of NULL

#74739
From: Kevin Boyes
Date: Sun, 03 Mar 1991 21:29
25 lines
1378 bytes
Hello all,

I am not sure if this is the right place for this but I'll try
it anyway.

I am very curious why so much of the GNU software that I see
tests for null pointers with 0 and not NULL.

In one case I am looking at right now, if NULL is not defined
they define it to be 0 but then proceed to test against 0 and
not the newly defined NULL. (this is in getopt.c from the bison
distribution)

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.

Will someone please explain this?

					Thanks
					K.

-- 
-- 
Kevin Boyes                                     kevinb@maccs.dcss.McMaster.CA
McMaster University                         ...!uunet!utai!utgpu!maccs!kevinb
Technical Details
Message-ID: <27D16AC5.3952@maccs.dcss.mcmaster.ca>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!lll-winken!elroy.jpl.nasa.gov!swrinde!cs.utexas.edu!news-server.csri.toronto.edu!utgpu!utzoo!mnetor!tmsoft!torsqnt!geac!maccs!kevinb

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1025b4,343b7ce3977dbb95,start
X-Google-Attributes: gid1025b4,public
X-Google-ArrivalTime: 1991-03-07 01:19:03 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!lll-winken!elroy.jpl.nasa.gov!swrinde!cs.utexas.edu!news-server.csri.toronto.edu!utgpu!utzoo!mnetor!tmsoft!torsqnt!geac!maccs!kevinb
From: kevinb@maccs.dcss.mcmaster.ca (Kevin Boyes)
Newsgroups: gnu.misc.discuss
Subject: using 0 instead of NULL
Message-ID: <27D16AC5.3952@maccs.dcss.mcmaster.ca>
Date: 3 Mar 91 21:29:40 GMT
Organization: McMaster University, Hamilton, Ontario, Canada
Lines: 25