Feature #5643

Consider suppressing some VC++ warnings to have a cleaner build output

Added by Kayra Akman over 5 years ago. Updated over 5 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


Consider the following application:

#include <Wt/WApplication>
#include <Wt/WEnvironment>

using namespace Wt;

WApplication *createApplication(const WEnvironment &env)
    return new WApplication(env);

int main(int argc, char *argv[])
    return WRun(argc, argv, &createApplication);

When compiled with Wt 3.3.7 MSVS2013 it produces the attached output. Qt Creator counts 98 warnings. Except a single C4275, all of the warnings are C4251 which is apparently harmless in the context of Wt since Wt applications are working as expected, but such warnings obscure more important warnings. An actual project with tens of source files easily produces thousands of warnings of which C4251 is the majority.

Assuming fixing C4251 is out-of-scope for Wt, IMHO C4251 should be suppressed in a central Wt header file included most, if not all, Wt applications.

When suppressed with a compiler option, other warnings are easily spotted. For example one Wt project of mine generates many C4100 warnings. These are mostly in Dbo headers. Also suppressing or fixing C4100 would make more important warnings stand out.

Although VC warnings led me writing this suggestion, I am sure similar warnings pollute other compilers' outputs as well.


warnings.txt (28 KB) warnings.txt Kayra Akman, 04/06/2017 12:04 PM

Updated by Wim Dumon over 5 years ago

Hi Kayra,

You're right in your observation that MSVS generates a lot of warnings that it shouldn't. However, we didn't want to put us in the place of the users and decide for them that particular warnings are never of interest, by secretly disabling them in some Wt header file. While building Wt and the examples, we actually do suppress a set of nonsense warnings.

Maybe we should change this policy, and actually disable the warnings by default unless a specific preprocessor symbol is defined.

I will make the change.



Updated by Wim Dumon over 5 years ago

  • Assignee set to Wim Dumon

Also available in: Atom PDF