title: Assert and unused local variable warning in GCC don't mix well?
body: <p>I have a problem with the unused local variable warning in GCC.</p>
  
  <p>Often I have code that looks like this:</p>
  
  <pre><code>bool success = foo();
  assert(success);
  </code></pre>
  
  <p>This is fine for debug builds. In release however, the assert compiles to nothing, and GCC gives me a warning.</p>
  
  <p>What is the best way to work around this? Wrapping the <code>bool success =</code> with #ifdef just does not seem like a nice solution...</p>