🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #1034

Re: Token pasting in #include directive

#1034
From: Rex Jaeschke
Date: Thu, 30 Nov 1989 16:14
40 lines
2051 bytes
> 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 )"?
> 
> Eh?  Why is the second any more correct than the first?  Since

I raised this in a paper at the Nashua, NH X3J11 meeting in 1988. It 
was agreed that the prototypes in the library section of the draft 
were NOT CONFORMING since they were in the user's namespace. The 
result was that I sumbitted words for the Rationale document 
explaining how they should really have been defined. See page 22 
bottom half of the Rationale, Nov '88.

For those of you without that document my examples contained something 
like the following (among other things):

	#define str *
	#include <string.h>
	
Consider that in string.h you have:

	size_t strlen(char *str);

After macro substitution, the prototype becomes:

	size_t strlen(char **);

and all your calls to strlen will fail because the types don't match. 
The bottom line is that you must not be able to rewrite a standard 
prototype from within a conforming program.

Rex

----------------------------------------------------------------------------
Rex Jaeschke     |  Journal of C Language Translation  | C Users Journal
(703) 860-0091   |        2051 Swans Neck Way          | DEC PROFESSIONAL
uunet!aussie!rex |     Reston, Virginia 22091, USA     | Programmers Journal
----------------------------------------------------------------------------
Convener of the Numerical C Extensions Group (NCEG)
----------------------------------------------------------------------------
Technical Details
Message-ID: <30.UUL1.3#5077@aussie.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uunet!aussie!rex
References: <970@sdrc.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uunet!aussie!rex
From: rex@aussie.UUCP (Rex Jaeschke)
Newsgroups: comp.std.c
Subject: Re: Token pasting in #include directive
Message-ID: <30.UUL1.3#5077@aussie.UUCP>
Date: 30 Nov 89 16:14:52 GMT
References: <970@sdrc.UUCP>
Organization: Journal of C Language Translation
Lines: 40