From 43653c0a7a90b88cabc53202b41d78f7aa4e89bc Mon Sep 17 00:00:00 2001 From: aj Date: Fri, 23 Nov 2001 10:01:16 +0000 Subject: * 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 --- gcc/cpplex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/cpplex.c') 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; -- cgit v1.2.1