Merge pull request #3069 from akortunov/msvc_warnings

Rework warnings settings
pull/593/head
Chris Djali 4 years ago committed by GitHub
commit f0cef87cd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -490,10 +490,6 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
if (CMAKE_CXX_COMPILER_ID STREQUAL GNU AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.6 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.6)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-but-set-parameter")
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL GNU AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 5.0 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 5.0)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsuggest-override")
endif()
endif (CMAKE_CXX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
# Extern
@ -584,63 +580,16 @@ if (WIN32)
# Play a bit with the warning levels
set(WARNINGS "/Wall") # Since windows can only disable specific warnings, not enable them
set(WARNINGS "/W4")
set(WARNINGS_DISABLE
# Warnings that aren't enabled normally and don't need to be enabled
# They're unneeded and sometimes completely retarded warnings that /Wall enables
# Not going to bother commenting them as they tend to warn on every standard library file
4061 4263 4264 4266 4350 4371 4435 4514 4548 4571 4582 4583 4610 4619 4623 4625
4626 4628 4640 4668 4710 4711 4768 4820 4826 4917 4946 5032 5039 5045 5219 5220
# Warnings that are thrown on standard libraries and not OpenMW
4347 # Non-template function with same name and parameter count as template function
4365 # Variable signed/unsigned mismatch
4510 4512 # Unable to generate copy constructor/assignment operator as it's not public in the base
4706 # Assignment in conditional expression
4738 # Storing 32-bit float result in memory, possible loss of performance
4774 # Format string expected in argument is not a string literal
4986 # Undocumented warning that occurs in the crtdbg.h file
4987 # nonstandard extension used (triggered by setjmp.h)
4996 # Function was declared deprecated
# caused by OSG
4589 # Constructor of abstract class 'osg::Operation' ignores initializer for virtual base class 'osg::Referenced' (False warning)
# caused by boost
4191 # 'type cast' : unsafe conversion (1.56, thread_primitives.hpp, normally off)
4643 # Forward declaring 'X' in namespace std is not permitted by the C++ Standard. (in *_std_fwd.h files)
5204 # Class has virtual functions, but its trivial destructor is not virtual
# caused by MyGUI
4297 # function assumed not to throw an exception but does
# OpenMW specific warnings
4099 # Type mismatch, declared class or struct is defined with other type
4100 # Unreferenced formal parameter (-Wunused-parameter)
4101 # Unreferenced local variable (-Wunused-variable)
4127 # Conditional expression is constant
4242 # Storing value in a variable of a smaller type, possible loss of data
4244 # Storing value of one type in variable of another (size_t in int, for example)
4245 # Signed/unsigned mismatch
4267 # Conversion from 'size_t' to 'int', possible loss of data
4305 # Truncating value (double to float, for example)
4309 # Variable overflow, trying to store 128 in a signed char for example
4351 # New behavior: elements of array 'array' will be default initialized (desired behavior)
4355 # Using 'this' in member initialization list
4464 # relative include path contains '..'
4505 # Unreferenced local function has been removed
4701 # Potentially uninitialized local variable used
4702 # Unreachable code
4714 # function 'QString QString::trimmed(void) &&' marked as __forceinline not inlined
4800 # Boolean optimization warning, e.g. myBool = (myInt != 0) instead of myBool = myInt
)
if (MSVC_VERSION GREATER 1800)
set(WARNINGS_DISABLE ${WARNINGS_DISABLE} 5026 5027
5031 # #pragma warning(pop): likely mismatch, popping warning state pushed in different file (config_begin.hpp, config_end.hpp)
4996 # Function was declared deprecated
)
endif()
if( "${MyGUI_VERSION}" VERSION_LESS_EQUAL "3.4.0" )
set(WARNINGS_DISABLE ${WARNINGS_DISABLE}

@ -1315,7 +1315,8 @@ public:
while (callback)
{
if ((composite = dynamic_cast<SceneUtil::CompositeStateSetUpdater*>(callback)))
composite = dynamic_cast<SceneUtil::CompositeStateSetUpdater*>(callback);
if (composite)
break;
callback = callback->getNestedCallback();

@ -35,7 +35,16 @@
#include <boost/iostreams/filtering_streambuf.hpp>
#include <boost/iostreams/copy.hpp>
#include <boost/iostreams/filter/zlib.hpp>
#if defined(_MSC_VER)
#pragma warning (push)
#pragma warning (disable : 4706)
#include <boost/iostreams/filter/zlib.hpp>
#pragma warning (pop)
#else
#include <boost/iostreams/filter/zlib.hpp>
#endif
#include <boost/iostreams/device/array.hpp>
#include <components/bsa/memorystream.hpp>

@ -176,7 +176,8 @@ namespace Interpreter{
transform(temp.begin(), temp.end(), temp.begin(), ::tolower);
}
if((found = check(temp, globals[j], &i, &start))){
found = check(temp, globals[j], &i, &start);
if(found){
char type = context.getGlobalType(globals[j]);
switch(type){

@ -126,8 +126,7 @@ osg::ref_ptr<Resource::BulletShape> BulletNifLoader::load(const Nif::File& nif)
{
Nif::Record* r = nif.getRoot(i);
assert(r != nullptr);
Nif::Node* node = nullptr;
if ((node = dynamic_cast<Nif::Node*>(r)))
if (Nif::Node* node = dynamic_cast<Nif::Node*>(r))
roots.emplace_back(node);
}
const std::string filename = nif.getFilename();

@ -312,8 +312,7 @@ namespace NifOsg
for (size_t i = 0; i < numRoots; ++i)
{
const Nif::Record* r = nif->getRoot(i);
const Nif::Node* nifNode = nullptr;
if ((nifNode = dynamic_cast<const Nif::Node*>(r)))
if (const Nif::Node* nifNode = dynamic_cast<const Nif::Node*>(r))
roots.emplace_back(nifNode);
}
if (roots.empty())
@ -609,7 +608,8 @@ namespace NifOsg
bool hasVisController = false;
for (Nif::ControllerPtr ctrl = nifNode->controller; !ctrl.empty(); ctrl = ctrl->next)
{
if ((hasVisController |= (ctrl->recType == Nif::RC_NiVisController)))
hasVisController |= (ctrl->recType == Nif::RC_NiVisController);
if (hasVisController)
break;
}

@ -194,8 +194,9 @@ void ShadowsBin::sortImplementation()
// noTestRoot is now a stategraph with useDiffuseMapForShadowAlpha disabled but minimal other state
bool cullFaceOverridden = false;
while ((root = root->_parent))
while (root->_parent)
{
root = root->_parent;
if (!root->getStateSet())
continue;
unsigned int cullFaceFlags = root->getStateSet()->getMode(GL_CULL_FACE);

Loading…
Cancel
Save