🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3171

Re: gcc and NULL function pointers.

#3171
From: Doug Gwyn
Date: Sat, 22 Jun 1991 04:37
16 lines
1399 bytes
In article <C62C9-2@xds13.ferranti.com> peter@ficc.ferranti.com (Peter da Silva) writes:
>> What about systems where different pointer types have different sizes?
>Then a different definition of NULL is appropriate.

NO NO NO.  There is NO appropriate definition of NULL if your criterion
be that it "work" without proper casting.  If you declare it as, say,
something that will work as an int*, then it cannot work as a char* on
a system where different pointer types have different sizes.

In other words, the problem you think you're trying to solve cannot be
solved in general.  As I said, you do nobody a favor when you make the
programmer think that he doesn't need to be careful (because your
implementation will "fix" his sloppiness).

All this stuff was thoroughly discussed in X3J11, by the way.  The
outcome was what you now see specified in the C standard.
Technical Details
Message-ID: <16481@smoke.brl.mil>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!spool.mu.edu!mips!swrinde!zaphod.mps.ohio-state.edu!think.com!yale.edu!cmcl2!adm!smoke!gwyn
References: <MR0CV2H@xds13.ferranti.com> <16468@smoke.brl.mil> <C62C9-2@xds13.ferranti.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!spool.mu.edu!mips!swrinde!zaphod.mps.ohio-state.edu!think.com!yale.edu!cmcl2!adm!smoke!gwyn
From: gwyn@smoke.brl.mil (Doug Gwyn)
Newsgroups: comp.std.c
Subject: Re: gcc and NULL function pointers.
Message-ID: <16481@smoke.brl.mil>
Date: 22 Jun 91 04:37:24 GMT
References: <MR0CV2H@xds13.ferranti.com> <16468@smoke.brl.mil> <C62C9-2@xds13.ferranti.com>
Organization: U.S. Army Ballistic Research Laboratory, APG, MD.
Lines: 16