This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Disable more MSVC warnings ?

Tags: None
(comma "," separated)
xerion
Registered Member
Posts
20
Karma
0

Disable more MSVC warnings ?

Wed Feb 28, 2018 8:30 am
There are a ton of warnings that the compiler reports at /W4 with VS 2017 and c++17 support (some might be applicable to W3 as well but never tested it).
One warning is applicable also in non C++17 "mode".

Comments to add in DisableStupidWarnings.h

Code: Select all
// 4127 - conditional expression is constant
// 4456 - declaration of 'identifier' hides previous local declaration
// 4996 - warning STL4007, STL4008


And change to the pragma
Code: Select all
#pragma warning( disable : 4100 4101 4127 4181 4211 4244 4273 4324 4456 4503 4512 4522 4700 4714 4717 4800 4996)


4456 is there without C++17 but needs W4
Since c++17 and if constexpr is out of the question 4127 should probably be silenced along with 4996

Examples

Warning C4456 declaration of 'SResPacketHalf' hides previous local declaration
3rdparty\eigen\eigen\src\Core\products\GeneralBlockPanelKernel.h 1584

Warning C4996 'std::binary_negate<_Fn>': warning STL4008: std::not1(), std::not2(), std::unary_negate, and std::binary_negate are deprecated in C++17. They are superseded by std::not_fn(). You can define _SILENCE_CXX17_NEGATORS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning. 3rdparty\eigen\eigen\src\Core\functors\StlFunctors.h 91

Warning C4996 'std::equal_to<double>::result_type': warning STL4007: Many result_type typedefs and all argument_type, first_argument_type, and second_argument_type typedefs are deprecated in C++17. You can define _SILENCE_CXX17_ADAPTOR_TYPEDEFS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning. 3rdparty\eigen\eigen\src\Core\util\Meta.h 385


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]