This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
c99 VLA semantics
- From: Mike Stump <mrs at apple dot com>
- To: gcc mailing list <gcc at gcc dot gnu dot org>
- Date: Thu, 15 Jun 2006 18:02:00 -0700
- Subject: c99 VLA semantics
Here are just a few more issues I was wondering about for VLAs:
static int i;
static int new_i() { i++; return i; }
static int bar(int a[new_i()][new_i()]);
void foo(int n) {
/* Presently an error, but, should it be (due to bar having a VM
type and bar having other than no linkage)? */
extern int bar(int a[new_i()][new_i()]);
/* Same question. */
extern void foo2(int i[n][n]);
}
void foo1(int n) {
goto A;
/* No error for this, but it is a VM type? */
void foo2(int i[n][n]);
/* Same question. */
int bar(int a[new_i()][new_i()]);
/* I think this is Ok. */
int (*(*foo3)(void))[n]; /* { dg-error "jump into
scope of identifier with variably modified type" } */
A:
;
}