What’s up with the thousands of warnings in standard headers in MSVC -Wall?

The Visual C++ /Wall enables all of the warnings that are disabled by default at /W4. As you’ve found out, there is a good reason why a lot of those warnings are disabled by default (thanks, compiler, for telling me you’ve added padding; I really appreciate it!). It’s probably best just to use /W4 on Visual C++.

Intel C++ is like this too (I don’t know about other compilers that utilize the EDG frontend). If you set it at /W5, it spews out tons of informational messages. My personal favorite is that it warns you if the storage class specifier isn’t at the beginning of a declaration (so, const static int is no go, but static const int is fine).

Leave a Comment