This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
__builtin_string_constant_p
- From: Florian Weimer <fw at deneb dot enyo dot de>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 11 Aug 2004 00:18:15 +0200
- Subject: __builtin_string_constant_p
For some routines that should only accept string literals, it would be
nice to have a __builtin_string_constant_p built-in. For example,
given
inline int foo(const char* p)
{
return __builtin_string_constant_p(p);
}
the expression
foo("bar")
shall evaluate to 1.
Adding it in parallel to __builtin_constant_p doesn't seem to work,
even if I use c_strlen(). The behavior is similar to
__builtin_constant_p, i.e. the macro case is not handled as expected.