We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example:
int Find(const std::vector<int>& x) { // proper code with return statement for all correct input values LOG(FATAL) << "x is bad"; }
The above code during compilation shows a warning:
warning: control may reach end of non-void function [-Wreturn-type]
The warning in general is useful, what about marking a subclass responsible for fatal messages with [[noreturn]]?
[[noreturn]]
Sources: [1] http://stackoverflow.com/questions/12146772/can-i-tell-the-compiler-to-consider-a-control-path-closed-with-regards-to-return [2] http://en.cppreference.com/w/cpp/language/attributes
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Example:
The above code during compilation shows a warning:
The warning in general is useful, what about marking a subclass responsible for fatal messages with
[[noreturn]]
?Sources:
[1] http://stackoverflow.com/questions/12146772/can-i-tell-the-compiler-to-consider-a-control-path-closed-with-regards-to-return
[2] http://en.cppreference.com/w/cpp/language/attributes
The text was updated successfully, but these errors were encountered: