On Dec 14, 2007, at 12:30 PM, Ted Kremenek wrote:
> Does anyone have any insights on the semantics of expressions of the
> form sizeof(sizeof(...))?
As you suspected the argument isn't evaluated because the type of the
argument isn't a variable length array. Put on your recursion hat and
just think about the first bit of the operand....
sizeof (...) has type size_t.
size_t isn't a VLA.
no need to consider anything instead of the (...).
For fun, try the follow on the old gray matter:
struct { char o[n][m]; } foo(int n, int m) { }
int main() {
return sizeof(foo(3,4));
}
:-)
_______________________________________________
cfe-dev mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev