aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-lex.c
diff options
context:
space:
mode:
authorGavin Romig-Koch <gavin@cygnus.com>1999-07-02 10:30:01 +0000
committerGavin Romig-Koch <gavin@gcc.gnu.org>1999-07-02 10:30:01 +0000
commit835f9b4dad11d84e385ea8fe8bba1b0e403f23f5 (patch)
tree5114691738cec02b4b8107a5fd681336bc2439d6 /gcc/c-lex.c
parente75a9d77196ec059245f3baaff6cf249102ea5e5 (diff)
downloadgcc-835f9b4dad11d84e385ea8fe8bba1b0e403f23f5.zip
gcc-835f9b4dad11d84e385ea8fe8bba1b0e403f23f5.tar.gz
gcc-835f9b4dad11d84e385ea8fe8bba1b0e403f23f5.tar.bz2
For gcc:
* c-decl.c (widest_integer_literal_type_node, widest_unsigned_literal_type) : New. (init_decl_processing): Handle/use the two new types. * c-common.c (type_for_size,type_for_mode) : Same. * c-lex.c (yylex) : Same. * c-typeck.c (unsigned_type,signed_type,signed_or_unsigned_type) : Same. * c-tree.h (widest_integer_literal_type_node, widest_unsigned_literal_type) : New. For gcc/cp: * cp-tree.h (widest_integer_literal_type_node, widest_unsigned_literal_type) : New. * decl.c (widest_integer_literal_type_node, widest_unsigned_literal_type) : New. (init_decl_processing): Handle/use the two new types. * lex.c (real_yylex): Same. * typeck.c (unsigned_type,signed_type,signed_or_unsigned_type) : Same. From-SVN: r27923
Diffstat (limited to 'gcc/c-lex.c')
-rw-r--r--gcc/c-lex.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index 214bcd1..ed825ee 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -1818,10 +1818,17 @@ yylex ()
else if (! spec_long_long)
traditional_type = (spec_unsigned ? long_unsigned_type_node
: long_integer_type_node);
- else
+ else if (int_fits_type_p (yylval.ttype,
+ spec_unsigned
+ ? long_long_unsigned_type_node
+ : long_long_integer_type_node))
traditional_type = (spec_unsigned
? long_long_unsigned_type_node
: long_long_integer_type_node);
+ else
+ traditional_type = (spec_unsigned
+ ? widest_unsigned_literal_type_node
+ : widest_integer_literal_type_node);
}
if (warn_traditional || ! flag_traditional)
{
@@ -1843,8 +1850,15 @@ yylex ()
&& int_fits_type_p (yylval.ttype,
long_long_integer_type_node))
ansi_type = long_long_integer_type_node;
- else
+ else if (int_fits_type_p (yylval.ttype,
+ long_long_unsigned_type_node))
ansi_type = long_long_unsigned_type_node;
+ else if (! spec_unsigned
+ && int_fits_type_p (yylval.ttype,
+ widest_integer_literal_type_node))
+ ansi_type = widest_integer_literal_type_node;
+ else
+ ansi_type = widest_unsigned_literal_type_node;
}
type = flag_traditional ? traditional_type : ansi_type;