diff options
author | Andreas Jaeger <aj@gcc.gnu.org> | 2001-11-23 11:01:16 +0100 |
---|---|---|
committer | Andreas Jaeger <aj@gcc.gnu.org> | 2001-11-23 11:01:16 +0100 |
commit | e1e7d56bf1be024a7c5b08f98d5ea524cc5ad64f (patch) | |
tree | e30331aeeafe31dbc96305e0796708b4684534c6 /gcc/cpplex.c | |
parent | 56101178c86f22b17a462d8bc50429fbb0c850b5 (diff) | |
download | gcc-e1e7d56bf1be024a7c5b08f98d5ea524cc5ad64f.tar.gz |
cpplex.c (cpp_interpret_charconst): Use HOST_WIDE_INT for sign extension.
* cpplex.c (cpp_interpret_charconst): Use HOST_WIDE_INT for sign
extension.
* gcc.dg/cpp/charconst-2.c: New test.
From-SVN: r47286
Diffstat (limited to 'gcc/cpplex.c')
-rw-r--r-- | gcc/cpplex.c | 4 |
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; |