🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3161

Re: gcc and NULL function pointers.

#3161
From: Doug Gwyn
Date: Thu, 20 Jun 1991 15:42
15 lines
1459 bytes
In article <MR0CV2H@xds13.ferranti.com> peter@ficc.ferranti.com (Peter da Silva) writes:
>Oh, I know it's incorrect. It's also common enough that a compiler vendor
>on a system where 0 doesn't have the same size and bit pattern as (void *)0
>would be foolish to #define NULL as 0 in <stdio.h>.
>Yes, it's better that everyone write correct code. But be liberal with
>what you accept... after all, the person you're punishing with a B&D
>definition of NULL is your customer.

You're NOT doing your customer any favor by catering to his misconceptions.
What about systems where different pointer types have different sizes?
There is no way the implementation can fully compensate for the programmer
having incorrectly coded his use of the NULL macro, and by trying to
accommodate such abuse at all you're merely reinforcing the mistaken notion
that caused the programmer to make the mistake in the first place.  Sooner
or later it is going to catch up with him, and the sooner the better.
Technical Details
Message-ID: <16468@smoke.brl.mil>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!think.com!yale.edu!cmcl2!adm!smoke!gwyn
References: <EE-B=O2@xds13.ferranti.com> <16418@smoke.brl.mil> <MR0CV2H@xds13.ferranti.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!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: <16468@smoke.brl.mil>
Date: 20 Jun 91 15:42:38 GMT
References: <EE-B=O2@xds13.ferranti.com> <16418@smoke.brl.mil> <MR0CV2H@xds13.ferranti.com>
Organization: U.S. Army Ballistic Research Laboratory, APG, MD.
Lines: 15