A
Alf P. Steinbach
I just added MSVC sillywarnings to this list as I encountered them.
Are there more that should be added?
Note: "unreferenced" warnings are handled by other explicit mechanism.
<code>
// Copyright (c) Alf P. Steinbach, 2010.
// #include <progrock/cppx/compiler_specific/msvc/no_sillywarnings_please.h>
#ifndef PROGROCK_CPPX_COMPILERSPECIFIC_MSVC_NOSILLYWARNINGSPLEASE_H
#define PROGROCK_CPPX_COMPILERSPECIFIC_MSVC_NOSILLYWARNINGSPLEASE_H
#ifndef _MSC_VER
# error This file is specific to the MSVC (Microsoft Visual C++) compiler.
#endif
#pragma warning( disable: 4061 ) // enum value is not *explicitly* handled in
switch
#pragma warning( disable: 4217 ) // member template isn't copy constructor
#pragma warning( disable: 4250 ) // inherits (implements) some member via
dominance
#pragma warning( disable: 4347 ) // "behavior change", function called
instead of template
#pragma warning( disable: 4355 ) // "'this': used in member initializer list
#pragma warning( disable: 4505 ) // unreferenced function has been removed
#pragma warning( disable: 4510 ) // default constructor could not be generated
#pragma warning( disable: 4511 ) // copy constructor could not be generated
#pragma warning( disable: 4512 ) // assignment operator could not be generated
#pragma warning( disable: 4513 ) // destructor could not be generated
#pragma warning( disable: 4623 ) // default constructor could not be generated
#pragma warning( disable: 4624 ) // destructor could not be generated
#pragma warning( disable: 4625 ) // copy constructor could not be generated
#pragma warning( disable: 4626 ) // assignment operator could not be generated
#pragma warning( disable: 4640 ) // a local static object is not thread-safe
#pragma warning( disable: 4670 ) // a base class of an exception class is
inaccessible for catch
#pragma warning( disable: 4672 ) // a base class of an exception class is
ambiguous for catch
#pragma warning( disable: 4673 ) // a base class of an exception class is
inaccessible for catch
#pragma warning( disable: 4675 ) // resolved overload was found by
argument-dependent lookup
#pragma warning( disable: 4702 ) // unreachable code, e.g. in <list> header.
#pragma warning( disable: 4710 ) // call was not inlined
#pragma warning( disable: 4711 ) // call was inlined
#pragma warning( disable: 4820 ) // some padding was added
#pragma warning( disable: 4917 ) // a GUID can only be associated with a
class, interface or namespace
// The following are real warnings but are generated by almost all MS headers,
including
// standard library headers, so it's impractical to leave them on.
#pragma warning( disable: 4619 ) // there is no warning number 'XXXX'
#pragma warning( disable: 4668 ) // XXX is not defined as a preprocessor macro
#endif
</code>
Cheers,
- Alf
Are there more that should be added?
Note: "unreferenced" warnings are handled by other explicit mechanism.
<code>
// Copyright (c) Alf P. Steinbach, 2010.
// #include <progrock/cppx/compiler_specific/msvc/no_sillywarnings_please.h>
#ifndef PROGROCK_CPPX_COMPILERSPECIFIC_MSVC_NOSILLYWARNINGSPLEASE_H
#define PROGROCK_CPPX_COMPILERSPECIFIC_MSVC_NOSILLYWARNINGSPLEASE_H
#ifndef _MSC_VER
# error This file is specific to the MSVC (Microsoft Visual C++) compiler.
#endif
#pragma warning( disable: 4061 ) // enum value is not *explicitly* handled in
switch
#pragma warning( disable: 4217 ) // member template isn't copy constructor
#pragma warning( disable: 4250 ) // inherits (implements) some member via
dominance
#pragma warning( disable: 4347 ) // "behavior change", function called
instead of template
#pragma warning( disable: 4355 ) // "'this': used in member initializer list
#pragma warning( disable: 4505 ) // unreferenced function has been removed
#pragma warning( disable: 4510 ) // default constructor could not be generated
#pragma warning( disable: 4511 ) // copy constructor could not be generated
#pragma warning( disable: 4512 ) // assignment operator could not be generated
#pragma warning( disable: 4513 ) // destructor could not be generated
#pragma warning( disable: 4623 ) // default constructor could not be generated
#pragma warning( disable: 4624 ) // destructor could not be generated
#pragma warning( disable: 4625 ) // copy constructor could not be generated
#pragma warning( disable: 4626 ) // assignment operator could not be generated
#pragma warning( disable: 4640 ) // a local static object is not thread-safe
#pragma warning( disable: 4670 ) // a base class of an exception class is
inaccessible for catch
#pragma warning( disable: 4672 ) // a base class of an exception class is
ambiguous for catch
#pragma warning( disable: 4673 ) // a base class of an exception class is
inaccessible for catch
#pragma warning( disable: 4675 ) // resolved overload was found by
argument-dependent lookup
#pragma warning( disable: 4702 ) // unreachable code, e.g. in <list> header.
#pragma warning( disable: 4710 ) // call was not inlined
#pragma warning( disable: 4711 ) // call was inlined
#pragma warning( disable: 4820 ) // some padding was added
#pragma warning( disable: 4917 ) // a GUID can only be associated with a
class, interface or namespace
// The following are real warnings but are generated by almost all MS headers,
including
// standard library headers, so it's impractical to leave them on.
#pragma warning( disable: 4619 ) // there is no warning number 'XXXX'
#pragma warning( disable: 4668 ) // XXX is not defined as a preprocessor macro
#endif
</code>
Cheers,
- Alf