This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: __builtin_string_constant_p


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]