For Programmers: Free Programming Magazines  


Home > Archive > C > February 2006 > Re: comp.lang.c FAQ list · Question 7.19b









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: comp.lang.c FAQ list · Question 7.19b
Harald van Dijk

2006-02-26, 6:55 pm

Keith Thompson wrote:
> Actually, C99 says
>
> If the type of the operand is a variable length array type, the
> operand is evaluated; otherwise, the operand is not evaluated and
> the result is an integer constant.
>
> But I can't think of a case where "evaluating" a variable length array
> has any effect other than determining its size (quite possibly I'm
> missing something).


How about this?

#include <stdio.h>
int main(int argc, char *argv[]) {
char vla[argc];
sizeof((&vla)[(puts("..."), 0)]);
}

Is that supposed to print something, then, or is there an exception for
this elsewhere? Or am I missing something that means the text does not
apply to this in the first place?

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com