After posting one of my most controversial answers here, I dare to ask a few questions and eventually fill some gaps in my knowledge.
Why isn't an expression of the kind ((type_t *) x)
considered a valid lvalue, assuming that x
itself is a pointer and an lvalue, not just some expression?
I know many will say "the standard disallows it", but from a logical standpoint it seems reasonable. What is the reason that the standard disallows it? After all, any two pointers are of the same size and the pointer type is just a compile-time abstraction that indicates the appropriate offset that should be applied when doing pointer arithmetic.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…