(constant_expression_warning)
authorRichard Stallman <rms@gnu.org>
Fri, 21 May 1993 19:31:40 +0000 (19:31 +0000)
committerRichard Stallman <rms@gnu.org>
Fri, 21 May 1993 19:31:40 +0000 (19:31 +0000)
(overflow_warning, convert_and_check): Change pedwarn to warning.

From-SVN: r4529

gcc/c-common.c

index ec5f8ada78d1e32eb323e9041d10310a12940146..b36a6aca51020e5d678fe1398ba5ec73f04f15c7 100644 (file)
@@ -347,7 +347,11 @@ constant_expression_warning (value)
 {
   if (TREE_CODE (value) == INTEGER_CST && TREE_CONSTANT_OVERFLOW (value))
     {
-      pedwarn ("overflow in constant expression");
+      /* ??? This is a warning, not a pedwarn, in 2.4,
+        because it happens in contexts that are not
+        "constant expressions" in ANSI C.
+        Fix the problem differently in 2.5.  */
+      warning ("overflow in constant expression");
       /* Suppress duplicate warnings.  */
       TREE_CONSTANT_OVERFLOW (value) = 0;
     }
@@ -366,7 +370,11 @@ overflow_warning (value)
 {
   if (TREE_CODE (value) == INTEGER_CST && TREE_CONSTANT_OVERFLOW (value))
     {
-      pedwarn ("integer overflow in expression");
+      /* ??? This is a warning, not a pedwarn, in 2.4,
+        because it happens in contexts that are not
+        "constant expressions" in ANSI C.
+        Fix the problem differently in 2.5.  */
+      warning ("integer overflow in expression");
       TREE_CONSTANT_OVERFLOW (value) = 0;
     }
 }
@@ -412,7 +420,11 @@ convert_and_check (type, expr)
        TREE_CONSTANT_OVERFLOW (t) = 0;
       else if (TREE_CONSTANT_OVERFLOW (t))
        {
-         pedwarn ("overflow in implicit constant conversion");
+         /* ??? This is a warning, not a pedwarn, in 2.4,
+            because it happens in contexts that are not
+            "constant expressions" in ANSI C.
+            Fix the problem differently in 2.5.  */
+         warning ("overflow in implicit constant conversion");
          TREE_CONSTANT_OVERFLOW (t) = 0;
        }
       else