[Bug c/12913] New: Jumps into variable length array scope not rejected

falk at debian dot org gcc-bugzilla@gcc.gnu.org
Wed Nov 5 17:23:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12913

           Summary: Jumps into variable length array scope not rejected
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: falk at debian dot org
                CC: gcc-bugs at gcc dot gnu dot org

gcc does not reject jumps over the declaration of a variable length array:

void f(int l) { 
  goto label; 
  int a[l]; 
 label:; 
} 
    
void g (int l) {
  switch (l) {
  case 1:;
    int a[l];
  default:;
  }
}

gcc 3.3 rejects at least the first case with the pretty misleading error message

test.c:4: error: label `label' used before containing binding contour

but mainline accepts both.



More information about the Gcc-bugs mailing list