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
There's only one problem with treating warnings as errors: When you're using code coming from other sources (e.g., micro$**t libraries, open source projects), they didn't do their job right, and compiling their code generates tons of warnings.
I always write my code so it doesn't generate any warnings or errors, and clean it up until it compiles without generating any extraneous noise. The garbage I have to work with appalls me, and I'm astounded when I have to build a big project and watch a stream of warnings go by where the compilation should only be announcing which files it processed.
I also document my code because I know the real lifetime cost of software comes mostly from maintenance, not from writing it initially, but that's a different story...