🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #1033

Re: macro parameter names

#1033
From: Karl Heuer
Date: Wed, 29 Nov 1989 20:35
22 lines
1603 bytes
In article <1989Nov27.223210.29880@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes:
>In article <18672@watdragon.waterloo.edu> afscian@violet.waterloo.edu (Anthony Scian) writes:
>>What about the library prototypes that are coded "int foo( int x, int y )"
>>when they should be "int foo( int __x, int __y )"?
>
>it doesn't look to me as if user identifiers of the same name can interfere
>with them.

I believe that
	#define x 0
	#include <stdlib.h>
	int main(void) { return x; }
is a strictly conforming program, but it would break if the header uses "x" as
an identifier.

However, I don't agree that this is a mistake in the document.  The prototypes
in the document are merely an anchor for discussing the semantics of the
function; they are not "examples" of how the vendor can legally implement the
header.  Note that prototypes are also supplied for functions that must be
implemented as macros.

Karl W. Z. Heuer (harvard!ima!karl or karl@ima.isc.com), The Walking Lint
Technical Details
Message-ID: <15299@haddock.ima.isc.com>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!think!snorkelwacker!spdcc!ima!haddock!karl
References: <11160@riks.csl.sony.co.jp> <1989Nov22.222413.3874@utzoo.uucp> <11188@riks.csl.sony.co.jp> <11685@smoke.BRL.MIL> <18672@watdragon.waterloo.edu> <1989Nov27.223210.29880@utzoo.uucp>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!think!snorkelwacker!spdcc!ima!haddock!karl
From: karl@haddock.ima.isc.com (Karl Heuer)
Newsgroups: comp.std.c
Subject: Re: macro parameter names
Message-ID: <15299@haddock.ima.isc.com>
Date: 29 Nov 89 20:35:39 GMT
References: <11160@riks.csl.sony.co.jp> <1989Nov22.222413.3874@utzoo.uucp> <11188@riks.csl.sony.co.jp> <11685@smoke.BRL.MIL> <18672@watdragon.waterloo.edu> <1989Nov27.223210.29880@utzoo.uucp>
Reply-To: karl@ima.isc.com (Karl Heuer)
Organization: Interactive Systems, Cambridge, MA 02138-5302
Lines: 22