summaryrefslogtreecommitdiffstats
path: root/gcc/cpplib.c
diff options
context:
space:
mode:
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2002-05-04 07:30:32 +0000
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2002-05-04 07:30:32 +0000
commit13c457e1923eefa04f4b52e5321ef6e2379d6a8b (patch)
tree39e01f86f161ea393ce56f05f0c0a0264050f332 /gcc/cpplib.c
parent364c5d83bb809b704995306cc743668535338a68 (diff)
downloadppe42-gcc-13c457e1923eefa04f4b52e5321ef6e2379d6a8b.tar.gz
ppe42-gcc-13c457e1923eefa04f4b52e5321ef6e2379d6a8b.zip
* c-lex.c (lex_string): Let cpp_parse_escape handles truncation
and sign-extension. (lex_charconst): Update for change in prototype of cpp_interpret_charconst. Extend from cppchar_t to HOST_WIDE_INT appropriately. * cpphash.h (BITS_PER_CPPCHAR_T): New. * cppinit.c (cpp_create_reader): Initialize them for no change in semantics. (cpp_post_options): Add sanity checks. * cpplex.c (cpp_parse_escape): Handle precision, sign-extension and truncation issues. Calculate in type cppchar_t. (MAX_CHAR_TYPE_SIZE, MAX_WCHAR_TYPE_SIZE): Remove. (cpp_interpret_charconst): Calculate in type cppchar_t. Handle run-time dependent precision correctly. Return whether the result is signed or not. * cpplib.c (dequote_string): Use cppchar_t; update. * cpplib.h (cppchar_signed_t): New. struct cpp_options): New precision members. (cpp_interpret_charconst, cpp_parse_escape): Update prototypes. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@53152 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cpplib.c')
-rw-r--r--gcc/cpplib.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index b210209b2e7..c90224c0b0a 100644
--- a/gcc/cpplib.c
+++ b/gcc/cpplib.c
@@ -726,23 +726,15 @@ dequote_string (pfile, str, len)
uchar *result = _cpp_unaligned_alloc (pfile, len + 1);
uchar *dst = result;
const uchar *limit = str + len;
- unsigned int c;
- unsigned HOST_WIDE_INT mask;
+ cppchar_t c;
- /* We need the mask to match the host's 'unsigned char', not the
- target's. */
- if (CHAR_BIT < HOST_BITS_PER_WIDE_INT)
- mask = ((unsigned HOST_WIDE_INT) 1 << CHAR_BIT) - 1;
- else
- mask = ~(unsigned HOST_WIDE_INT)0;
-
while (str < limit)
{
c = *str++;
if (c != '\\')
*dst++ = c;
else
- *dst++ = cpp_parse_escape (pfile, (const uchar **)&str, limit, mask);
+ *dst++ = cpp_parse_escape (pfile, &str, limit, 0);
}
*dst++ = '\0';
return result;
OpenPOWER on IntegriCloud