Path: utzoo!utgpu!attcan!uunet!husc6!rutgers!att!cuuxb!mmengel From: mmengel@cuuxb.ATT.COM (~XT4103000~Marc Mengel~C25~G25~6184~) Newsgroups: comp.std.c Subject: Re: Concatenating tokens that aren't parameters, in ANSI C Message-ID: <1946@cuuxb.ATT.COM> Date: 27 Jul 88 14:54:36 GMT References: <4963@hoptoad.uucp> Reply-To: mmengel@cuuxb.UUCP (PUT YOUR NAME HERE) Organization: AT&T, Data Systems Group, Lisle, IL Lines: 33 In article <4963@hoptoad.uucp> gnu@hoptoad.uucp (John Gilmore) writes: [old code breaks under ANSI cpp follows] >#define LFD 6 >#define LHIGH 1.0e+LFD >which expanded to >1.0e+6 [tried] >#define LHIGH 1.0e+ ## LFD [and also] >#define cat_a(a,b) a ## b >#define cat_b(a,b) a ## b >#define LHIGH cat_a(1.0e+,cat_b(LFD,)) > >should work, but it produces: > >1.0e+cat_b(6 ,) Hmmm. seeems like maybe #define LFD 6 #define BASE 1.0e #define LHIGH LFD+BASE might just work, I don't have a gcc cpp handy to test it though. (It works under SysV cc. >John Gilmore {sun,pacbell,uunet,pyramid,amdahl}!hoptoad!gnu gnu@toad.com -- Marc Mengel attmail!mmengel {lll-crg|mtune|ihnp4}!cuuxb!mmengel