aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpplex.c
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.demon.co.uk>2002-05-05 17:05:09 +0000
committerNeil Booth <neil@gcc.gnu.org>2002-05-05 17:05:09 +0000
commit2443d4e110e88050c438b4db7cba7b47dfb90893 (patch)
tree97978ba189f956d7357a86c98b15c1b1b5adaa02 /gcc/cpplex.c
parent791a949fb9c633016bdb00f954979c53b0e75e9a (diff)
downloadgcc-2443d4e110e88050c438b4db7cba7b47dfb90893.zip
gcc-2443d4e110e88050c438b4db7cba7b47dfb90893.tar.gz
gcc-2443d4e110e88050c438b4db7cba7b47dfb90893.tar.bz2
c-common.c (c_common_init): Set up CPP arithmetic.
* c-common.c (c_common_init): Set up CPP arithmetic. * cppinit.c (cpp_create_reader): Default CPP arithmetic to something reasonable for the host. (sanity_checks): Add checks. (cpp_read_main_file): Call sanity_checks() from here... (cpp_post_options): ... not here. * cpplex.c (cpp_interpret_charconst): Get max_chars right. * cpplib.h (struct cpp_options): New member int_precision. testsuite: * gcc.dg/cpp/charconst.c: Update tests. From-SVN: r53186
Diffstat (limited to 'gcc/cpplex.c')
-rw-r--r--gcc/cpplex.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/cpplex.c b/gcc/cpplex.c
index 51c82b2..ee34512 100644
--- a/gcc/cpplex.c
+++ b/gcc/cpplex.c
@@ -1883,11 +1883,13 @@ cpp_interpret_charconst (pfile, token, warn_multi, pchars_seen, unsignedp)
if (token->type == CPP_CHAR)
{
width = CPP_OPTION (pfile, char_precision);
+ max_chars = CPP_OPTION (pfile, int_precision) / width;
unsigned_p = CPP_OPTION (pfile, signed_char) == 0;
}
else
{
width = CPP_OPTION (pfile, wchar_precision);
+ max_chars = 1;
unsigned_p = WCHAR_UNSIGNED;
}
@@ -1895,7 +1897,6 @@ cpp_interpret_charconst (pfile, token, warn_multi, pchars_seen, unsignedp)
mask = ((cppchar_t) 1 << width) - 1;
else
mask = ~0;
- max_chars = BITS_PER_CPPCHAR_T / width;
while (str < limit)
{