Hi,

On 11/10/2015 05:36 PM, Marek Polacek wrote:
+
+               /* Did array size calculations overflow or does the array
+                  cover more than half of the address-space?  */
+               if (COMPLETE_TYPE_P (type)
+                   && TREE_CODE (TYPE_SIZE_UNIT (type)) == INTEGER_CST
+                   && !valid_constant_size_p (TYPE_SIZE_UNIT (type)))
+                 {
+                   if (name)
+                     error_at (loc, "size of array %qE is too large", name);
+                   else
+                     error_at (loc, "size of unnamed array is too large");
+                   type = error_mark_node;
+                 }
              }
Obviously "the issue" predates your proposed change, but I don't understand why the code implementing the check can't be shared by the front-ends via a small function in c-family...

Paolo.

Reply via email to