3 ms·
Agree on the alarm bells with the pointer arithmetic. Disagree that gcc is doing the right thing here. The clang behavior (different comment in this thread) i
by mpweiher 8y ago
Agree on the alarm bells with the pointer arithmetic.
Disagree that gcc is doing the right thing here. The clang behavior (different comment in this thread) is much more sane: if the pointers happen to be the same, they compare as equal. If the pointers happen to not be the same, they compare as not equal.
- shakna 8y agoExcept clang's behaviour changes depending on the optimisation level. If you use -O1, then you get a different result.
- mpweiher 8y agoYes, because the pointers are different at -O. As there are no guarantees as to the relative placement of auto/stack variables relative to each other, that is perfectly fine.
- deleted 8y ago[deleted]