Article View: net.lang.c++
Article #162Re: System V preprocessor problem with <generic.h>
From: guy
Date: Tue, 29 Apr 1986 02:11
Date: Tue, 29 Apr 1986 02:11
22 lines
1311 bytes
1311 bytes
> Try this fix for system V cpp:
>
> #define name2(a,b) a/**/b
> #define name3(a,b,c) a/**/b/**/c
>
> This works because the system V cpp strips the comments from the input.
So do earlier versions of Reiser's "cpp"; this is the "canonical" way of
concatenating two arguments to a macro, and is heavily used in 4BSD. It
has, however, two problems:
1) If you run your code through "lint", it won't work - "cpp"
is run by "lint" with the "-C" flag, which tells it not to
strip comments (for obvious reasons).
2) It is not a guaranteed property of the C language, but a
quirk of the implementation, so it will not work in
general.
--
Guy Harris
{ihnp4, decvax, seismo, decwrl, ...}!sun!guy
guy@sun.arpa
Technical Details
Message-ID:
<3597@sun.uucp>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!decwrl!sun!guyReferences:
<410@cit-vax.Caltech.Edu> <228@sfsup.UUCP>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!decwrl!sun!guy From: guy@sun.UUCP Newsgroups: net.lang.c++,net.lang.c Subject: Re: System V preprocessor problem with <generic.h> Message-ID: <3597@sun.uucp> Date: Mon, 28-Apr-86 22:11:05 EDT Article-I.D.: sun.3597 Posted: Mon Apr 28 22:11:05 1986 Date-Received: Fri, 2-May-86 06:34:34 EDT References: <410@cit-vax.Caltech.Edu> <228@sfsup.UUCP> Followup-To: net.lang.c Distribution: net Organization: Sun Microsystems, Inc. Lines: 22