Path: utzoo!utgpu!watserv1!watmath!att!ima!dirtydog!karl From: karl@ima.isc.com (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: Talking about scanf Message-ID: <1990Nov18.001632.10219@dirtydog.ima.isc.com> Date: 18 Nov 90 00:16:32 GMT References: <16582@netcom.UUCP> <960@mwtech.UUCP> <1990Nov16.125504.305@sc2a.unige.ch> Sender: news@dirtydog.ima.isc.com (NEWS ADMIN) Reply-To: karl@ima.isc.com (Karl Heuer) Organization: Interactive Systems Lines: 17 In article <1990Nov16.125504.305@sc2a.unige.ch> fisher@sc2a.unige.ch writes: >As another workaround, it seems that some compilers *do* expand macros inside >strings and character constants, in which case you could use the `X' there. I refuse to believe that. Some non-ANSI preprocessors expand *macro arguments* inside string literals within the macro, but I've never heard of one that expanded macros in string literals in the program. It would break too much code. >In TC, for example, you can "stringize" a macro... It's not a TC invention; stringizing and string literal pasting are available in all ANSI C compilers. Note that it doesn't help you if X was defined as an expression like `(99+1)', since the C preprocessor (unlike, say, m4) doesn't have a way to reduce constant expressions. Karl W. Z. Heuer (karl@ima.isc.com or uunet!ima!karl), The Walking Lint