"Variable may be uninitialized when used here" Xcode compiler warning
<p>So I wrote this little <a href="https://projecteuler.net/problem=4" rel="nofollow noreferrer">program</a> that gives this warning despite the fact that I have the variable initialized, not a <a href="https://stackoverflow.com/questions/6813660/warning-uninitialized-variable-but-i-have-initialized-c-compiler-bug">duplicate question</a>.</p>

<pre><code>int main(int argc, const char * argv[]) {
    @autoreleasepool {

        int num1, num2, product, largestProduct = 0;

        while (num2 &lt; 1000) {

            while (num1 &lt; 1000) {

                product = num1 * num2;

                if (isPalindrome(product)) {

                    largestProduct = product&gt;largestProduct?product:largestProduct;
                }

                num1++;
            }

            num1 = 0; //If I delete that line the warning disappears.
            num2++;
        }

       NSLog(@"%i", largestProduct);

    }
    return 0;
}
</code></pre>

<p>The weird thing is if I delete that commented line the warning disappears, and if I initialize <code>num1</code> individually it also disappears. Am I doing something wrong or is that a bug in Xcode?</p>