Saturday, February 8, 2014

Why Eclipse Kepler complaining invalid overload of endl?

This code cout << "blah blah blah" << endl; not suppose to be an error. Interestingly Eclipse Kepler state that this was an error:

Invalid overload of 'endl'

My mistake again? A stupid though passing by my brain, urging me to trying out this experiment:
    ...
    cout << "blah blah blah";
    cout << endl;
    ...
And this will compile OK. Miracle happen? Anyhow there is a cure for this problem:
  1. Windows menu > choose Preferences option > select Code Analysis on left panel.
  2. Under Syntax and Semantic Errors > change Invalid overload's severity from Error to Warning.
I wasn't really sure why Eclipse have such configuration, a message drop to Eclipse forum regarding this problem, and they reply that there was a fix on this error. Should be on the way on next release I guess.

No comments: