https://llvm.org/bugs/show_bug.cgi?id=24287

            Bug ID: 24287
           Summary: No error that the designated index in an array
                    initializer is too large
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangb...@nondot.org
          Reporter: akyr...@gmail.com
                CC: llvmbugs@cs.uiuc.edu
    Classification: Unclassified

=======
#include <limits.h>

char vals1[ULONG_MAX] = { // error: array is too large (18446744073709551615
elements)
};

char vals2[] = {
  [ULONG_MAX-1] = 0 // no error
};
=======

The second array initialization will trigger huge memory usage (for creating
all these initializer expressions) but no error like in the constant array
case.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
LLVMbugs@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to