Here is the question
Is "missing semicolon" error really required? why not treat it as a warning?
Why I am asking this stupid question?
When I compile this code
int f = 1
int h=2;
the compiler intelligently tells me that where I am missing it. but to me its like - "If you know it, just treat it as if its there and go ahead. (Later I can fix the warning)
int sdf = 1,df=2;
sdf=1 df =2
even for this code it behaves the same. i.e even if multiple statements (without ;) are in the same line, the compiler knows.
So, why not just remove this requirement? why not behave like python,vb etc
Summary of discussion
2 examples/instances were missing semi-colon would actually cause a problem.
1.
return
(a+b)
This was presented as 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 ; insertion is done after return. i.e missing return value.
2
int *y;
int f = 1
*y = 2;
For this I guess, there is no better way than to introduce as statement seperator i.e semicolon