"missing return statement", but I know it is there
<p>Assume I have the following function:</p>

<pre><code>// Precondition:  foo is '0' or 'MAGIC_NUMBER_4711'
// Returns:       -1 if foo is '0'
//                 1 if foo is 'MAGIC_NUMBER_4711'
int transmogrify(int foo) {
    if (foo == 0) {
        return -1;
    } else if (foo == MAGIC_NUMBER_4711) {
        return 1;
    }
}
</code></pre>

<p>The compiler complains "missing return statement", but I know that <code>foo</code> never has different values than <code>0</code> or <code>MAGIC_NUMBER_4711</code>, or else my function shall have no defined semantics. </p>

<p>What are preferable solutions to this? 
Is this really an issue, i.e. what does the standard say?</p>
