Why didn't the compiler warn me about an empty if-statement?
<p>I'm using <a href="https://en.wikipedia.org/wiki/Keil_(company)" rel="nofollow noreferrer">Keil</a> µVision v4.74 and have enabled the option &quot;All Warnings&quot;.</p>
<p>I wrote the following <strong>intentional</strong> code:</p>
<pre><code>if(condition matched)
{
  // Do something
}
</code></pre>
<p>When I rebuilt my project, I got 0 errors, 0 warnings.</p>
<p>However, when I <strong>accidentally</strong> wrote:</p>
<pre><code>if(condition matched);
{
  // Do something
}
</code></pre>
<p>I also got 0 errors, 0 warnings.</p>
<p>It was next to impossible for me to find out that a small <code>;</code> following the <em>if</em> condition was the root of the problem.</p>
<p>Why didn't the compiler treat it as a warning and inform me?</p>