Commit 88dd95c1 by Richard Stallman

(yylex): When traditional, convert 0x80000000 to -0x80000000.

From-SVN: r1738
parent aaf5be8b
...@@ -1577,7 +1577,17 @@ yylex () ...@@ -1577,7 +1577,17 @@ yylex ()
&& !warn) && !warn)
pedwarn ("integer constant out of range"); pedwarn ("integer constant out of range");
TREE_TYPE (yylval.ttype) = type; if (flag_traditional && !int_fits_type_p (yylval.ttype, type))
/* The traditional constant 0x80000000 is signed
but doesn't fit in the range of int.
This will change it to -0x80000000, which does fit. */
{
TREE_TYPE (yylval.ttype) = unsigned_type (type);
yylval.ttype = convert (type, yylval.ttype);
}
else
TREE_TYPE (yylval.ttype) = type;
*p = 0; *p = 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment