__builtin_string_constant_p

Jakub Jelinek jakub@redhat.com
Wed Aug 11 08:24:00 GMT 2004


On Wed, Aug 11, 2004 at 10:00:40AM +0200, Andreas Schwab wrote:
> That will pass for every expression, since #text is always expanded to a
> string literal.  You probably want this:
> 
>          #define assert_string_constant(text) (void)(text "")
> 
> but that's not a 100% solution either, since text may be something like
> 1000 + "foobar" (but I can thing of any useful non-literal that would
> pass).

So maybe
#define assert_string_constant(text) (void)("" text "")

	Jakub



More information about the Gcc mailing list