From 835f9b4dad11d84e385ea8fe8bba1b0e403f23f5 Mon Sep 17 00:00:00 2001 From: Gavin Romig-Koch Date: Fri, 2 Jul 1999 10:30:01 +0000 Subject: 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 --- gcc/c-lex.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'gcc/c-lex.c') 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; -- cgit v1.1