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
COMPILER WARNINGS ARE YOUR FRIEND (not shouting, uppercase for emphasis).
I work on legacy Fortran-77 systems. The compiler tells me valuable things: argument datatype mismatches on a subroutine call, using a local variable before a value has been set into the variable, if I have a variable or subroutine argument that is not used. These are almost always errors.
Avoiding a long post: When my code compiles cleanly, 97% it works. The other guy I work with compiles with all warnings off, spends hours or days in the debugger, then asks me to help. I just compile his code with the warnings on and tell him what to fix.