Pointers Are More Abstract Than You Might Expect in C
I like the behavior of the compiler here. There is no guarantee that a and b are next to each other in memory. That&#x27;s why the comparison fails, the alternative makes is runtime&#x2F;compiler&#x2F;optimization level dependent which would be a total mess.<p>As usual with those C bashing articles you won&#x27;t run into trouble if you don&#x27;t try very hard to write contrived code.
I mean, the moment you see:<p><pre><code>     int *q = &amp;b + 1;
</code></pre>
on your screen alarm bells should go off. Doing pointer arithmetic on something that is not an array is asking for trouble. If the standard should be amended in any way it should be undefined behavior right away you do pointer arithmetic on non-array objects.