Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!world!madd From: madd@world.std.com (jim frost) Newsgroups: comp.unix.aix Subject: Re: Bugs in RISC System/6000 C compiler Keywords: bad macro substitution Message-ID: <1990Sep21.191937.1289@world.std.com> Date: 21 Sep 90 19:19:37 GMT References: <9756@bunny.GTE.COM> <3824@segue.segue.com> Organization: Saber Software Lines: 32 jim@segue.segue.com (Jim Balter) writes: >In article <9756@bunny.GTE.COM> hhd0@GTE.COM (Horace Dediu) writes: >[ problems with macros ] >The problem is most likely in your CAT macro, which probably looks like >#define CAT(a,b) a/**/b >instead you should use >#ifdef __STDC__ >#define CAT(a,b) a##b >#else >#define IDENT(x)x >#define CAT(a,b)IDENT(a)b >#endif Yes, it depends on mode. In `cc' mode (-qlanglvl=extended) the old-style concatenation works. In `xlc' mode (ANSI) you must use the double-sharp. Thus you can write: #ifdef __STDC__ #define CAT(a,b) a##b #else #define CAT(a,b) a/**/b #endif jim frost saber software jimf@saber.com