I often hear that when compiling C and C++ programs I should \"always enable compiler warnings\". Why is this necessary? How do I do that?
Sometimes I also hear tha
You should definitely enable compiler warnings as some compilers are bad at reporting some common programming mistakes, including the following:-
-> initialise a variable gets forgotten -> return a value from a function get missed -> the simple arguments in printf and scanf families not matching the format string a function is used without being declared beforehand, though happens in c only
So as these functions can be detected and reported, just usually not by default; so this feature must be explicitly requested via compiler options.