Re: c99 VLA semantics

2006-06-16 Thread Mike Stump
On Jun 16, 2006, at 6:57 AM, Dave Korn wrote: static int bar(int a[new_i()][new_i()]); If that isn't a sequence point violation, it probably ought to be, shouldn't it? No, the text has no meaning (in this case (non (const int))), read it as `'*' and you'll have a better mental model for

Re: c99 VLA semantics

2006-06-16 Thread Mike Stump
Ok, good, you gave the same answers I was hoping for. :-) On Jun 16, 2006, at 10:51 AM, Joseph S. Myers wrote: But the definition in terms of contained declarators hardly makes things clear. I would say, however, that while VM-ness shouldn't propagate out from function argument types to the

Re: c99 VLA semantics

2006-06-16 Thread Joseph S. Myers
On Thu, 15 Jun 2006, Mike Stump wrote: > 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()]); Same as static int bar(int a[*][*]);. (In a definition, the two calls to new_i() happen

RE: c99 VLA semantics

2006-06-16 Thread Dave Korn
On 16 June 2006 02:02, Mike Stump wrote: > 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()]); If that isn't a sequence point violation, it probably ought to be, shouldn't it?

c99 VLA semantics

2006-06-15 Thread Mike Stump
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)? */ ex