[LLVMbugs] [Bug 3562] New: clarify error on gcc vla-in-struct extension

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Feb 12 08:52:12 PST 2009


           Summary: clarify error on gcc vla-in-struct extension
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Semantic Analyzer
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: daniel at zuster.org
                CC: llvmbugs at cs.uiuc.edu

clang should give a clearer error on code that uses gcc's "vla-in-struct"
extension (is there a name for it?):
ddunbar at milton:gcc$ cat t.c
void f0(int n,...) {
  struct S {
    double          a[n];
  }               s;
  double x = s.a[0];
ddunbar at milton:gcc$ clang t.c
t.c:3:21: error: fields must have a constant size
    double          a[n];
t.c:5:14: error: subscripted value is neither array nor pointer
  double x = s.a[0];
             ^   ~
2 diagnostics generated.

Something like "This gcc extension is not supported, and will hopefully never
be. Change your code you loon." It'd be nice not to get the second error as

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list