/* CPP Library - lexical analysis.
- Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007-2013
- Free Software Foundation, Inc.
+ Copyright (C) 2000-2013 Free Software Foundation, Inc.
Contributed by Per Bothner, 1994-95.
Based on CCCP program by Paul Rubin, June 1986
Adapted to ANSI C, Richard Stallman, Jan 1987
from inttypes.h, we generate a warning and treat the ud-suffix as a
separate preprocessing token. This approach is under discussion by
the standards committee, and has been adopted as a conforming
- extension by other front ends such as clang. */
- if (ISALPHA (*cur))
+ extension by other front ends such as clang.
+ A special exception is made for the suffix 's' which will be
+ standardized as a user-defined literal suffix for strings. */
+ if (ISALPHA (*cur) && *cur != 's')
{
/* Raise a warning, but do not consume subsequent tokens. */
if (CPP_OPTION (pfile, warn_literal_suffix))
"a space between literal and identifier");
}
/* Grab user defined literal suffix. */
- else if (*cur == '_')
+ else if (ISIDST (*cur))
{
type = cpp_userdef_string_add_type (type);
++cur;
from inttypes.h, we generate a warning and treat the ud-suffix as a
separate preprocessing token. This approach is under discussion by
the standards committee, and has been adopted as a conforming
- extension by other front ends such as clang. */
- if (ISALPHA (*cur))
+ extension by other front ends such as clang.
+ A special exception is made for the suffix 's' which will be
+ standardized as a user-defined literal suffix for strings. */
+ if (ISALPHA (*cur) && *cur != 's')
{
/* Raise a warning, but do not consume subsequent tokens. */
if (CPP_OPTION (pfile, warn_literal_suffix))
"a space between literal and identifier");
}
/* Grab user defined literal suffix. */
- else if (*cur == '_')
+ else if (ISIDST (*cur))
{
type = cpp_userdef_char_add_type (type);
type = cpp_userdef_string_add_type (type);
is neither : nor >, the < is treated as a preprocessor
token by itself". */
if (CPP_OPTION (pfile, cplusplus)
- && (CPP_OPTION (pfile, lang) == CLK_CXX11
- || CPP_OPTION (pfile, lang) == CLK_GNUCXX11)
+ && CPP_OPTION (pfile, lang) != CLK_CXX98
+ && CPP_OPTION (pfile, lang) != CLK_GNUCXX
&& buffer->cur[1] == ':'
&& buffer->cur[2] != ':' && buffer->cur[2] != '>')
break;
len = MIN_BUFF_SIZE;
len = CPP_ALIGN (len);
+#ifdef ENABLE_VALGRIND_CHECKING
+ /* Valgrind warns about uses of interior pointers, so put _cpp_buff
+ struct first. */
+ size_t slen = CPP_ALIGN2 (sizeof (_cpp_buff), 2 * DEFAULT_ALIGNMENT);
+ base = XNEWVEC (unsigned char, len + slen);
+ result = (_cpp_buff *) base;
+ base += slen;
+#else
base = XNEWVEC (unsigned char, len + sizeof (_cpp_buff));
result = (_cpp_buff *) (base + len);
+#endif
result->base = base;
result->cur = base;
result->limit = base + len;
for (; buff; buff = next)
{
next = buff->next;
+#ifdef ENABLE_VALGRIND_CHECKING
+ free (buff);
+#else
free (buff->base);
+#endif
}
}