The Dreaded C4786 Warning (MS Visual C++ 6)
(Looking for a freelance software developer? You found one. Visit the home page.)
(To give a little back to the software community, we make these pages and packages available. We hope they're as useful to you as they are to us. See our Disclaimer.)
MSVC6's Dreaded C4786 Warning
Do you use Microsoft's Visual C++ v6.x compiler? Are you buried in C4786 (or C4096) compiler warnings? Can't get rid of them, even with #pragma warning (disable : 4786)? Tempted to ratchet back the warning level, but don't want to lose important warnings?
Building with zero warnings is important: if you've turned up the warning level and addressed each warning, you understand your code much better. That matters.
The C4786 problem with is the compiler, not you. Even though you're using the #pragma everywhere, the compiler has to compile template code separately, and that code doesn't get this pragma. There's no way to get it there.
The only way to "fix" this is to filter them out. Though this is a hassle, we're convinced it's worth it. So we wrote this little compiler-wrapper program to help:
MSVC6-C4786-FIX.zip (38 Kb).
For instructions, see the top of the CPP file. Happy warning-free coding.
Previous page: Contributions
Next page: The Unix Clock Overflow in 2038