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]

__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.


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