You _CAN_ "stringize" tokens in (some) K&R pre-processors

Richard Barnette barnettr at snaggle.rtp.dg.com
Thu Apr 4 10:07:15 AEST 1991


In article <323 at secola.Columbia.NCR.COM> jmartin at secola.Columbia.NCR.COM (John V. Martinez) writes:
>
>	I seem to recall a thread of discussion a couple of weeks ago
>about how to "stringize" a token using the K&R C preprocessor (ANSI C
>provides the # operator to do this.) Anyway, as I recall, the concensus
>was that it couldn't be done. (At least, no one submitted a method, as 
>far as I know...)
>

    Some preprocessors will accept

#define stringize(A) "A"

GNU C will do this if you say -traditional.  The AT&T unix compilers
tend to do this (but I reckon it depends on your system).
Richard Barnette      | Data General Corporation | obligatory (in)famous quote:
(919) 248-6225        | RTP, NC  27709	         |  You wascal wabbit!
Commercial Languages  | 62 T.W. Alexander Drive	 |  Wandering wizards won't
barnettr at dg-rtp.dg.com				 |  win! - /usr/lib/sendmail



More information about the Comp.lang.c mailing list