The following code does NOT suppress ANY C4503 compiler warnings, but it does suppress C4244 warnings.
#pragma warning(push)
#pragma warning(disable:4503)
#pragma warning(disable:4244)
#include <map>
#include <string>
int main(int argc, char *argv[])
{
class Field;
typedef std::map<std::string, Field * > Screen;
typedef std::map<std::string, Screen> WebApp;
typedef std::map<std::string, WebApp> WebAppTest;
typedef std::map<std::string, WebAppTest> Hello;
Hello MyWAT; // The C4503 error is NOT suppressed
int a;
a = 5.0f; // The C4244 error is suppressed
}
#pragma warning(pop)
Please definitively explain why C4503 warnings are not suppressed. Note: it might be due to a similar reason as referenced in How can I work around warning C4505 in third party libraries?.
See this and this for more relevant infornation.
I'm using Visual Studio 2008 on a Windows 7 machine.
Not clear from the context, but maybe you have too many #pragma
statements? MSDN says:
The compiler only supports up to 56 #pragma warning statements in a compiland.
Bit weird but you can disable this warning using your exact code just by removing the #pragma warning(pop)
. I don't understand why though.
I should say I'm on VS2010 C++ Express edition.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With