fixed bug with 0L; don't give warning on char x[3] = "abc"
authoreck <none@none>
Fri, 9 Feb 1990 10:35:44 +0000 (10:35 +0000)
committereck <none@none>
Fri, 9 Feb 1990 10:35:44 +0000 (10:35 +0000)
lang/cem/cemcom.ansi/LLlex.c
lang/cem/cemcom.ansi/ival.g

index 0ea8aa9..9f6dfb8 100644 (file)
@@ -806,7 +806,7 @@ struct token *ptok;
                        fund = LONG;
                else    fund = UNSIGNED;
        } else if((val & full_mask[(int)long_size]) == val) {
-               if (val > 0) fund = LONG;
+               if (val >= 0) fund = LONG;
                else fund = ULONG;
        } else {        /* sizeof(arith) is greater than long_size */
                ASSERT(arith_size > long_size);
index e6c185b..9b27605 100644 (file)
@@ -582,8 +582,14 @@ ch_array(tpp, ex)
        else {
                arith dim = tp->tp_size / tp->tp_up->tp_size;
 
-               if (length > dim) {
-                       expr_warning(ex, "too many initialisers");
+#ifdef LINT
+               if (length == dim + 1) {
+                           expr_warning(ex, "array is not null-terminated");
+               } else
+#else
+               if (length > dim + 1) {
+#endif
+                       expr_strict(ex, "too many initialisers");
                }
                length = dim;
        }