title: "dereferencing type-punned pointer will break strict-aliasing rules" warning
body: <p>I use a code where I cast an enum* to int*. Something like this:</p>
  
  <pre><code>enum foo { ... }
  ...
  foo foobar;
  int *pi = reinterpret_cast&lt;int*&gt;(&amp;foobar);
  </code></pre>
  
  <p>When compiling the code (g++ 4.1.2), I get the following warning message:</p>
  
  <pre><code>dereferencing type-punned pointer will break strict-aliasing rules
  </code></pre>
  
  <p>I googled this message, and found that it happens only when strict aliasing optimization is on. I have the following questions:</p>
  
  <ul>
  <li>If I leave the code with this warning, will it generate potentially wrong code?</li>
  <li>Is there any way to work around this problem?</li>
  <li>If there isn't, is it possible to turn off strict aliasing from inside the source file (because I don't want to turn it off for all source files and I don't want to make a separate Makefile rule for this source file)?</li>
  </ul>
  
  <p>And yes, I actually need this kind of aliasing.</p>