title: Using Likely() / Unlikely() Preprocessor Macros in if-else if chain
body: <p>If I have:</p>
  
  <pre><code>#define likely(x)       __builtin_expect((x),1)
  #define unlikely(x)     __builtin_expect((x),0)
  
  if (A)
      return true;
  else if (B)
      return false;
  ...
  else if (Z)
      return true;
  else
      //this will never really happen!!!!
      raiseError();
      return false;
  </code></pre>
  
  <p>Can I put likely() around the last condition check like <code>else if (likely(Z))</code> to signify that the final statement (else) is very unlikely WITHOUT the compiler affecting the branch prediction of the previous checks? </p>
  
  <p>Basically, does GCC try to optimize the entire if-else if block if there is a single conditional statement with a branch predictor hint?</p>