🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3170

Re: gcc and NULL function pointers.

#3170
From: Blair P. Houghton
Date: Fri, 21 Jun 1991 05:46
37 lines
1945 bytes
In article <SR0CXCH@xds13.ferranti.com> peter@ficc.ferranti.com (Peter da Silva) writes:
>I'm not responsible for that code. I know it's wrong. It is, however,
>something that I have to fix over and over and over again because one
>of your co-workers at intel decided to use a bondage-and-discipline
>definition of NULL in <stdio.h>. Technically correct, but practically
>a problem.

Do a global search-and-replace on the files, especially
if you ever expect to redistribute the code.  That's why
standard headers were invented, to be standard.  By
mucking about in yours, you engender bad design in
locally-produced software.

>I have better things to do with my time than fixing all the broken
>software in comp.sources.

There are about eight ways to attack this obvious piece of
bait, none of which I'm about to bother with.

>If I can get it working by futzing around
>in a defs.h file instead of groveling through the source to elm (a
>particularly poorly written example), I will.

Grovelling? All you need is

    sed 's/\([^_A-Za-z]\)NULL\([^_A-Za-z]\)/\1(void *)NULL\2/g'

>And: on an intel 80x86 (x<3) the best definition for NULL is (void *)0.

I wouldn't know.  I've never owned one. (But I bet
Barry Margolin never owned a Connection Machine,
either... :-)).  I would guess, however, that
the "best" definition is still `0'.

				--Blair
				  "It's what I'd use
				   on my personal Delta..."
Technical Details
Message-ID: <4796@inews.intel.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!mips!cs.uoregon.edu!ogicse!intelhf!ichips!inews!hopi!bhoughto
References: <EE-B=O2@xds13.ferranti.com> <4728@inews.intel.com> <SR0CXCH@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!mips!cs.uoregon.edu!ogicse!intelhf!ichips!inews!hopi!bhoughto
From: bhoughto@hopi.intel.com (Blair P. Houghton)
Newsgroups: comp.std.c
Subject: Re: gcc and NULL function pointers.
Message-ID: <4796@inews.intel.com>
Date: 21 Jun 91 05:46:35 GMT
References: <EE-B=O2@xds13.ferranti.com> <4728@inews.intel.com> <SR0CXCH@xds13.ferranti.com>
Sender: news@inews.intel.com
Organization: Intel Corp, Chandler, AZ
Lines: 37