summaryrefslogtreecommitdiff
path: root/gcc/cppexp.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/cppexp.c
parent364c5d83bb809b704995306cc743668535338a68 (diff)
downloadgcc-13c457e1923eefa04f4b52e5321ef6e2379d6a8b.tar.gz
* 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/cppexp.c')
-rw-r--r--gcc/cppexp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/cppexp.c b/gcc/cppexp.c
index 914a2070ac4..b71b02abfd2 100644
--- a/gcc/cppexp.c
+++ b/gcc/cppexp.c
@@ -283,10 +283,10 @@ eval_token (pfile, token)
const cpp_token *token;
{
unsigned int temp;
+ int unsignedp = 0;
struct op op;
op.op = CPP_NUMBER;
- op.unsignedp = 0;
switch (token->type)
{
@@ -294,9 +294,8 @@ eval_token (pfile, token)
return parse_number (pfile, token);
case CPP_WCHAR:
- op.unsignedp = WCHAR_UNSIGNED;
- case CPP_CHAR: /* Always unsigned. */
- op.value = cpp_interpret_charconst (pfile, token, 1, &temp);
+ case CPP_CHAR:
+ op.value = cpp_interpret_charconst (pfile, token, 1, &temp, &unsignedp);
break;
case CPP_NAME:
@@ -331,6 +330,7 @@ eval_token (pfile, token)
op.value = temp;
}
+ op.unsignedp = unsignedp;
return op;
}