3 ms·
> Arbitrary transformations on pointers (including constructing them directly from integers, and one might guess the stack address of x) are "only" undefined b
by MaxBarraclough 8y ago
> Arbitrary transformations on pointers (including constructing them directly from integers, and one might guess the stack address of x) are "only" undefined behaviour in C, not prohibited statically.
Sure, that's what it means to have full pointer arithmetic. It's very much an aim away from face feature of the language.
- dbaupp 8y agoYes, that is exactly my point. It's a dangerous feature of the language, or, said another way, has a lot of potential for undefined behaviour. If one is trying to reword the standard to control undefined behaviour, this is one feature that needs to be considered.