🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sources.d
Article #122

Re: nn and 80286 processors

#122
From: Tim McDaniel
Date: Tue, 04 Jul 1989 20:28
27 lines
1794 bytes
In article <803@cimcor.mn.org> mike@cimcor.mn.org (Michael Grenier)
writes (more or less):
> Changed arguments in call to setupterm to NULL,1,NULL from 0,1,0 in
> term.c since the first and third parameters are supposed to be
> pointers. 

0,1,0 is indeed incorrect; the compiler has to know that the 0s are
pointers and not just ints (since null pointers are permitted to have
a size and/or internal representation different than an int 0).

The proposed ANSI C standard permits NULL to be #defined as 0.  Many
existing sites have this #definition.  Therefore, to change 0,1,0 to
NULL,1,NULL will often do nothing, and will be as incorrect as before.

The correct fix is to cast NULL to the proper argument type, as in
        (struct foobar *) NULL, 1, (struct stoat *) NULL

If it's unclear why this is so, e-mail me and I'll send you some
comp.lang.c articles by Chris Torek.
--
"Let me control a planet's oxygen supply, and I don't care who makes
the laws." - GREAT CTHUHLU'S STARRY WISDOM BAND (via Roger Leroux)
 __
   \         Tim, the Bizarre and Oddly-Dressed Enchanter
    \               mcdaniel@uicsrd.csrd.uiuc.edu
    /\       mcdaniel%uicsrd@{uxc.cso.uiuc.edu,uiuc.csnet}
  _/  \_     {uunet,convex,pur-ee}!uiucuxc!uicsrd!mcdaniel
Technical Details
Message-ID: <1415@garcon.cso.uiuc.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!uxc.cso.uiuc.edu!garcon!uicsrd.csrd.uiuc.edu!mcdaniel
References: <803@cimcor.mn.org>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!uxc.cso.uiuc.edu!garcon!uicsrd.csrd.uiuc.edu!mcdaniel
From: mcdaniel@uicsrd.csrd.uiuc.edu (Tim McDaniel)
Newsgroups: comp.sources.d
Subject: Re: nn and 80286 processors
Keywords: patches
Message-ID: <1415@garcon.cso.uiuc.edu>
Date: 4 Jul 89 20:28:30 GMT
References: <803@cimcor.mn.org>
Sender: news@garcon.cso.uiuc.edu
Reply-To: mcdaniel@uicsrd.csrd.uiuc.edu (Tim McDaniel)
Organization: Center for Supercomputing R&D (Cedar), U. of Ill.
Lines: 27