🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #1029

Re: Token pasting in #include directive

#1029
From: T. William Wells
Date: Wed, 29 Nov 1989 14:04
28 lines
1422 bytes
In article <970@sdrc.UUCP> scjones@sdrc.UUCP (Larry Jones) 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 )"?
:
: Eh?  Why is the second any more correct than the first?  Since
: the argument names in a prototype only have prototype scope, they
: can't conflict with any other names in the program and therefor
: do not need leading underscores.

Consider macros. E.g.:

#define source "you're screwed"
#include <string.h>

and assume that string.h has things like:

extern char *strcpy(char *dest, const char *source);

You make it, instead,

extern char *strcpy(char *__dest, const char *__source);

and that way the user won't screw up your prototypes.

---
Bill                    { uunet | novavax | ankh | sunvice } !twwells!bill
bill@twwells.com
Technical Details
Message-ID: <1989Nov29.140417.2394@twwells.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!novavax!twwells!bill
References: <11160@riks.csl.sony.co.jp> <1989Nov22.222413.3874@utzoo.uucp> <18672@watdragon.waterloo.edu> <970@sdrc.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!novavax!twwells!bill
From: bill@twwells.com (T. William Wells)
Newsgroups: comp.std.c
Subject: Re: Token pasting in #include directive
Message-ID: <1989Nov29.140417.2394@twwells.com>
Date: 29 Nov 89 14:04:17 GMT
References: <11160@riks.csl.sony.co.jp> <1989Nov22.222413.3874@utzoo.uucp> <18672@watdragon.waterloo.edu> <970@sdrc.UUCP>
Organization: None, Ft. Lauderdale, FL
Lines: 28