summaryrefslogtreecommitdiff
path: root/gcc/cpplex.c
diff options
context:
space:
mode:
authoraj <aj@138bc75d-0d04-0410-961f-82ee72b054a4>2001-11-23 10:01:16 +0000
committeraj <aj@138bc75d-0d04-0410-961f-82ee72b054a4>2001-11-23 10:01:16 +0000
commit43653c0a7a90b88cabc53202b41d78f7aa4e89bc (patch)
treee30331aeeafe31dbc96305e0796708b4684534c6 /gcc/cpplex.c
parentbdf632d6ce2cf0c6aefa5fa12b9b602e5a5bb18a (diff)
downloadgcc-43653c0a7a90b88cabc53202b41d78f7aa4e89bc.tar.gz
* cpplex.c (cpp_interpret_charconst): Use HOST_WIDE_INT for sign
extension. * gcc.dg/cpp/charconst-2.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47286 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cpplex.c')
-rw-r--r--gcc/cpplex.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/cpplex.c b/gcc/cpplex.c
index 924863f1fca..35411e615c1 100644
--- a/gcc/cpplex.c
+++ b/gcc/cpplex.c
@@ -1,5 +1,5 @@
/* CPP Library - lexical analysis.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001 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
@@ -1922,8 +1922,8 @@ cpp_interpret_charconst (pfile, token, warn_multi, traditional, pchars_seen)
if (token->type == CPP_CHAR && chars_seen)
{
unsigned int nbits = chars_seen * width;
- unsigned int mask = (unsigned int) ~0 >> (HOST_BITS_PER_INT - nbits);
+ mask = (unsigned HOST_WIDE_INT) ~0 >> (HOST_BITS_PER_WIDE_INT - nbits);
if (pfile->spec_nodes.n__CHAR_UNSIGNED__->type == NT_MACRO
|| ((result >> (nbits - 1)) & 1) == 0)
result &= mask;