I'm trying to enable some warnings that detail potential security problems through a pragma. The warnings are those listed by Jon Sturgeon in “Off By Default” Compiler Warnings in Visual C++:
# pragma warning (enable: 4191 4242 4263 4264 4265 4266 4302 4826 4905 4906 4928)
I'm getting a warning under Visual Studio (2010 to be exact) for the above pragma:
ClCompile:
pch.cpp
... config.h(238): warning C4615: #pragma warning : unknown user warning type
It appears there is no enable
or on
for pragma warning
. There is a once
, but I want to see all instances of the potential problems, and not just one.
Microsoft's documentation on warning does not appear to discuss the topic of enabling warnings.
I can't really use # pragma warning (default: ...)
because they are off by default. I don't want to modify each of the solution's configurations because the solution has 4 projects, 6 configurations and 4 platforms. So I have 80+ of them to change (the cross product of the selections).
How do I enable select warnings through the pragma?