Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!ames!ptsfa!ihnp4!homxb!gemini From: gemini@homxb.UUCP Newsgroups: comp.lang.c Subject: Re: cpp macro expansion Message-ID: <229@homxb.UUCP> Date: Fri, 17-Apr-87 06:23:34 EST Article-I.D.: homxb.229 Posted: Fri Apr 17 06:23:34 1987 Date-Received: Sat, 18-Apr-87 05:33:24 EST References: <2857@linus.UUCP> <5764@brl-smoke.ARPA> Organization: PC Research, Inc. Lines: 23 Keywords: cpp, #define, macro Summary: But what about In article <5764@brl-smoke.ARPA>, gwyn@brl-smoke.UUCP writes: > Unfortunately C a la K&R did not provide any way to do such > "token pasting". People using the Reiser CPP (found on most > UNIX systems) typically resorted to the following trick: > #define GLUE(a,b) a/**/b > However, this is not guaranteed to work and, indeed, is > guaranteed NOT to work in X3J11-compliant compilers. The > X3J11 invention for token pasting is: > #define GLUE(a,b) a ## b > You will probably not find many compilers implementing this > yet, since this part of the spec kept changing. And we of course have a third method here at AT&T. The preprocessor distributed with 4th generation make uses: #define GLUE(a,b) a\+b Can you say non-compliant? I knew you could. Maybe X3J11 should consider BOTH latter methods, especially since I'm in a love/hate relationship with 4th generation make, and have GLUE(me,==nonportable) Rick Richardson, PC Research, Inc: (201) 922-1134 ..!ihnp4!castor!pcrat!rick when at AT&T-CPL: (201) 834-1378 ..!ihnp4!castor!polux!rer