aboutsummaryrefslogtreecommitdiff
path: root/gcc/cppexp.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cppexp.c')
-rw-r--r--gcc/cppexp.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/cppexp.c b/gcc/cppexp.c
index 4fc833c..b3a7ce6 100644
--- a/gcc/cppexp.c
+++ b/gcc/cppexp.c
@@ -375,10 +375,13 @@ cpp_interpret_integer (pfile, token, type)
if (overflow)
cpp_error (pfile, DL_PEDWARN,
"integer constant is too large for its type");
- else if (!result.unsignedp && !num_positive (result, precision))
+ /* If too big to be signed, consider it unsigned. Only warn for
+ decimal numbers. Traditional numbers were always signed (but
+ we still honour an explicit U suffix). */
+ else if (!result.unsignedp
+ && !CPP_OPTION (pfile, traditional)
+ && !num_positive (result, precision))
{
- /* If too big to be signed, consider it unsigned. Only warn
- for decimal numbers. */
if (base == 10)
cpp_error (pfile, DL_WARNING,
"integer constant is so large that it is unsigned");