The Problem with Friendly C
If ((uint32_t)x&lt;&lt;32)==x on one system, and ((uint32_t)x&lt;&lt;32)==0 on another, why is that a problem? The issue isn&#x27;t that one system behaves differently from another. The issue is that compilers take it upon themselves to decide that because code would behave differently on these different systems - which is why the standard leaves it undefined - it can be considered to fall into some kind of black hole that allows the compiler to do whatever it likes.<p>But why can&#x27;t it just produce something different on each system?<p>Allow me to call it as I see it: the modern interpretation of undefined behaviour is bullshit. What compilers do today should be the recourse of absolute last resort, and the sort of thing that makes its authors feel bad. But it seems to be treated as a matter of course.<p>I don&#x27;t know what to say.<p>Mandatory reading: <a href="http:&#x2F;&#x2F;robertoconcerto.blogspot.co.uk&#x2F;2010&#x2F;10&#x2F;strict-aliasing.html" rel="nofollow">http:&#x2F;&#x2F;robertoconcerto.blogspot.co.uk&#x2F;2010&#x2F;10&#x2F;strict-aliasin...</a> (&quot;Everyone is fired&quot;); <a href="https:&#x2F;&#x2F;groups.google.com&#x2F;forum&#x2F;#!msg&#x2F;boring-crypto&#x2F;48qa1kWignU&#x2F;o8GGp2K1DAAJ" rel="nofollow">https:&#x2F;&#x2F;groups.google.com&#x2F;forum&#x2F;#!msg&#x2F;boring-crypto&#x2F;48qa1kWi...</a> (&quot;these people simply don&#x27;t understand what most C
programmers want&quot;); <a href="http:&#x2F;&#x2F;blog.metaobject.com&#x2F;2014&#x2F;04&#x2F;cc-osmartass.html" rel="nofollow">http:&#x2F;&#x2F;blog.metaobject.com&#x2F;2014&#x2F;04&#x2F;cc-osmartass.html</a> (&quot;please don&#x27;t do this, you&#x27;re not producing value&quot;)