| Robin Haigh 2006-02-26, 6:55 pm |
|
"Keith Thompson" <kst-u@mib.org> wrote in message
news:lnirr2fydc.fsf@nuthaus.mib.org...
> Michael Mair <Michael.Mair@invalid.invalid> writes:
> [...]
>
> 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).
I don't think it can mean what it appears to say. The case that needs
evaluation is
sizeof(int[expression])
where the operand is a type.
But in
int n = 17;
int b[3][n];
sizeof b[expression];
the type of the operand b[expression] would appear to be int[n], which is a
VLA type. But we don't need to evaluate expression, and complications set
in if we do.
--
RSH
|