This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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:
;
}



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]