The following is a simplified version of a pattern I sometimes see in my students' code:
bool foobar(int a, int b)
{
if (a < b) return true;
}
The real code is more complicated, of course. Visual Studio reports a warning C4715 (not all control paths return a value), and I would like to treat all warnings C4715 as errors. Is that possible?
-Werror
for a project of mine and realized it has a down-side, which is that when i'm developing the code it's helpful to have mistakes categorized as errors or warnings. I can see "aha, 2 warnings and 1 error" and start anticipating what i probably did wrong better than if i just see "3 errors". Really-Werror
seems only necessary if that's the only way to get people to eliminate warnings in the code. – Kearse