Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!davis From: davis@pacific.mps.ohio-state.edu ("John E. Davis") Newsgroups: comp.lang.c Subject: gcc bug (was: Re: You _CAN_ "stringize" tokens in (some) K&R pre-processors) Message-ID: Date: 4 Apr 91 02:56:42 GMT References: <323@secola.Columbia.NCR.COM> <2127@gold.gvg.tek.com> Sender: news@pacific.mps.ohio-state.edu Reply-To: davis@pacific.mps.ohio-state.edu (John E. Davis) Distribution: comp.lang.c Organization: "Dept. of Physics, The Ohio State University" Lines: 34 In-reply-to: shaunc@gold.gvg.tek.com's message of 3 Apr 91 03:29:03 GMT In article <2127@gold.gvg.tek.com> shaunc@gold.gvg.tek.com (Shaun Case) writes: [...] #include #define quote " #define stringize(a) (quote a"+1) main() { printf("[%s]\n",stringize(foo)); } --- cut here --- Is there some reason why this is a bad idea? I compiled it and ran it on a sun4 using CC as well as cc. It ran as expected. However it failed to run under gcc: [pacific]>gcc test.c test.c: In function main: test.c:8: `foo' undeclared (first use this function) test.c:8: (Each undeclared identifier is reported only once test.c:8: for each function it appears in.) [pacific]> So does this mean there is a bug in gcc? -- John bitnet: davis@ohstpy internet: davis@pacific.mps.ohio-state.edu