On C-optimizing compilers removing code that has undefined behavior
&gt; The programmer has clearly attempted to set  x[0]=0<p>Then why not just write it like that? This is like deliberately shooting yourself in the foot and complaining that your shotgun works.