This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
This code has missed semicolon (in 'int amount =' line), but IDE highlights this code as wrong: #include <iostream> using namespace std; int readNumberOf(const char* item, int min, int max) { cout << "Enter number of " << item << " (" << min << " <= N <= " << max << "): "; string s; getline(cin, s); int amount = strtol(s.c_str(), 0, 10) cout << endl; if (amount < min) { cout << "number of " << item << " cannot be less than " << min << '.' << endl; cout << min << " item is taken" << endl << endl; amount = min; } else if (amount > max) { cout << "number of " << item << " cannot be more than " << max << '.' << endl; cout << max << " items is taken" << endl << endl; amount = max; } return amount; }
Other testcase: int f() { return 0; } int main(int argc, char**argv) { int i; i = i + 1 f(); return 0; }
For now, error highlighting does not claim that it shows *all* errors. This *is* an issue, but I believe it does not deserve more than P4.
still reproduced