🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3160

Re: gcc and NULL function pointers.

#3160
From: Norman Diamond
Date: Fri, 21 Jun 1991 03:35
27 lines
2194 bytes
In article <9752@cognos.UUCP> jimp@cognos.UUCP (Jim Patterson) writes:
>Which is why there should be a standard definition. It avoids suprises
>when porting to new environments.

Correct coding avoids most surprises.  If a correctly written program gets
a surprise, ask the compiler vendor for a refund.
(DISCLAIMER:  This is personal opinion; my emplyer did not write this.)

>Except for the substantial prior art for #define NULL (0), I think
>(void*)0 is ALWAYS the best definition.
>Of course, prior art is an important consideration, so I can't fault
>the X3J11 group for leaving the definition somewhat ill-defined, but
>if it were designed again from scratch I think the argument for 
>#define NULL (0) would be pretty weak.

If C were designed again from scratch, it might have (void*) from scratch.
Remember, a lot of null pointers were coded when C didn't have (void*)?
Also, if C were designed again from scratch, NULL might be a reserved word,
built into the language like in every other language that has pointers,
instead of being #defined in terms of anything.

Also, if C were designed again from scratch, it wouldn't be C.  Kernighan
and Ritchie would probably be willing to apply lessons of the 70's.
--
Norman Diamond       diamond@tkov50.enet.dec.com
If this were the company's opinion, I wouldn't be allowed to post it.
Permission is granted to feel this signature, but not to look at it.
Technical Details
Message-ID: <1991Jun21.033508.20151@tkou02.enet.dec.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!decwrl!deccrl!news.crl.dec.com!nntpd.lkg.dec.com!tkou02.enet.dec.com!jit533!diamond
References: <EE-B=O2@xds13.ferranti.com> <FISCHER.91Jun18210809@cauchy.iesd.auc.dk> <1991Jun19.182420.12673@athena.mit.edu> <ND1CKO3@xds13.ferranti.com> <9752@cognos.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!decwrl!deccrl!news.crl.dec.com!nntpd.lkg.dec.com!tkou02.enet.dec.com!jit533!diamond
From: diamond@jit533.swstokyo.dec.com (Norman Diamond)
Newsgroups: comp.std.c
Subject: Re: gcc and NULL function pointers.
Message-ID: <1991Jun21.033508.20151@tkou02.enet.dec.com>
Date: 21 Jun 91 03:35:08 GMT
References: <EE-B=O2@xds13.ferranti.com> <FISCHER.91Jun18210809@cauchy.iesd.auc.dk> <1991Jun19.182420.12673@athena.mit.edu> <ND1CKO3@xds13.ferranti.com> <9752@cognos.UUCP>
Sender: usenet@tkou02.enet.dec.com (USENET News System)
Reply-To: diamond@jit533.enet@tkou02.enet.dec.com (Norman Diamond)
Organization: Digital Equipment Corporation Japan , Tokyo
Lines: 27