3 ms·
To me, the question is what is actually "the type system" and what is "the allocation system" or whatever else aspect of implementing a compiler. So determinin
by jstimpfle 6y ago
To me, the question is what is actually "the type system" and what is "the allocation system" or whatever else aspect of implementing a compiler.
So determining the type of "&a" is not an issue, it's just one case in determining the type of a C expression (look up the object "a", is it an array? The type of the expression is a pointer to the array element type).
This is not a special case, at least not more special than how to determine the type of the expression "a", or "1".
No array type needed.
- hvdijk 6y agoAre you aware that given int a[3];, (&a+1) and (a+3) denote the same address? If you are, how can that possibly work if as you suggest, &a and a are indistinguishable to the compiler, that they are both seen as a pointer to int?
- jstimpfle 6y agoThat came quite honestly as a huge surprise to me. I've never seen this before. Thanks for the heads up!