Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!mintaka!spdcc!dirtydog!karl From: karl@ima.isc.com (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: gcc bug (was: Re: You _CAN_ "stringize" tokens in (some) K&R pre-processors) Message-ID: <1991Apr04.031040.29629@ima.isc.com> Date: 4 Apr 91 03:10:40 GMT References: <323@secola.Columbia.NCR.COM> <2127@gold.gvg.tek.com> Sender: usenet@ima.isc.com Reply-To: karl@ima.isc.com (Karl Heuer) Distribution: comp.lang.c Organization: Interactive Systems, Cambridge, MA 02138-5302 Lines: 17 In article davis@pacific.mps.ohio-state.edu (John E. Davis) writes: >[The program which included] > #define quote " > #define stringize(a) (quote a"+1) >...failed to run under gcc... So does this mean there is a bug in gcc? No, since the program contains unbalanced quotes (and is therefore incorrect), the way gcc chooses to resolve the error is no more buggy than the way the Reiser cpp resolves it. If you really need stringizing (and few programs do, even if they think so), then use |#a| with ANSI compilers, |"a"| with compilers that use the Reiser cpp (or any bug-for-bug compatible cpp), and the above hack on any others. And when you encounter an implementation where none of them work, complain to the person who told you that you really needed stringizing. Karl W. Z. Heuer (karl@ima.isc.com or uunet!ima!karl), The Walking Lint