Feature #5643
openConsider suppressing some VC++ warnings to have a cleaner build output
0%
Description
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.
Files
Updated by Wim Dumon about 8 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.
Wim.