Work around a GCC code generation bug if XXX_BROKEN_GCC; fixed NetBSD
authortholo <tholo@openbsd.org>
Tue, 5 Mar 1996 08:48:15 +0000 (08:48 +0000)
committertholo <tholo@openbsd.org>
Tue, 5 Mar 1996 08:48:15 +0000 (08:48 +0000)
PR 2097

usr.bin/xlint/lint1/cgram.y

index e65584a..502994d 100644 (file)
@@ -1607,15 +1607,26 @@ toicon(tn)
        } else {
                i = (int)v->v_quad;
                if (isutyp(t)) {
-                       if ((u_quad_t)v->v_quad > INT_MAX) {
+                       if ((u_quad_t)v->v_quad > UINT_MAX) {
                                /* integral constant too large */
                                warning(56);
                        }
                } else {
+#ifdef XXX_BROKEN_GCC
+                       if (v->v_quad > INT_MAX) {
+                               /* integral constant too large */
+                               warning(56);
+                       }
+                       if (v->v_quad < INT_MIN) {
+                               /* integral constant too large */
+                               warning(56);
+                       }
+#else
                        if (v->v_quad > INT_MAX || v->v_quad < INT_MIN) {
                                /* integral constant too large */
                                warning(56);
                        }
+#endif
                }
        }
        free(v);