title: Semicolon in C++?
body: <p>Is the "missing semicolon" error really required? Why not treat it as a warning?</p>
  
  <p>When I compile this code</p>
  
  <pre><code>int f = 1
  int h=2;
  </code></pre>
  
  <p>the compiler intelligently tells me that where I am missing it. But to me it's like - "If you know it, just treat it as if it's there and go ahead. (Later I can fix the warning.)</p>
  
  <pre><code>  int sdf = 1, df=2;
    sdf=1 df =2
  </code></pre>
  
  <p>Even for this code, it behaves the same. That is, even if multiple statements (without ;) are in the same line, the compiler knows.</p>
  
  <p>So, why not just remove this requirement? Why not behave like <a href="http://en.wikipedia.org/wiki/Python_%28programming_language%29" rel="nofollow noreferrer">Python</a>, <a href="http://en.wikipedia.org/wiki/Visual_Basic" rel="nofollow noreferrer">Visual Basic</a>, etc.</p>
  
  <p><strong>Summary of discussion</strong></p>
  
  <p>Two examples/instances were missing, and a semi-colon would actually cause a problem.</p>
  
  <p>1.</p>
  
  <pre><code>return
   (a+b)
  </code></pre>
  
  <p>This was presented as one of the worst aspects of JavaScript. But, in this scenario, semicolon insertion is a problem for JavaScript, but not
  for C++. In C++, you will get another error if <code>;</code> insertion is done after return. That is, a missing return value.</p>
  
  <p>2</p>
  
  <pre><code>int *y;
  int f = 1
  *y = 2;
  </code></pre>
  
  <p>For this I guess, there is no better way than to introduce as statement separator, that is, a <strong>semicolon</strong>.</p>