diff --git a/CMakeLists.txt b/CMakeLists.txt index f00adc07..91b421ba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -87,12 +87,7 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") /we4554 # check operator precedence for possible error; use parentheses to clarify precedence /w14100 # unreferenced formal parameter /w14189 # local variable is initialized but not referenced - /we4456 # declaration of 'var' hides previous local declaration - ) - if(CMAKE_CXX_FLAGS_RELWITHDEBINFO) - set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /Ob2") - set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Ob2") - endif() + /we4456) # declaration of 'var' hides previous local declaration endif() string(REPLACE ";" " " E2D_SHARED_CXX_FLAGS "${E2D_SHARED_CXX_FLAGS}") diff --git a/samples/sources/sample_06/sample_06.cpp b/samples/sources/sample_06/sample_06.cpp index 9947b56c..c8c64dfb 100644 --- a/samples/sources/sample_06/sample_06.cpp +++ b/samples/sources/sample_06/sample_06.cpp @@ -53,8 +53,8 @@ namespace }); } - owner.for_joined_components([ - ](ecs::entity e, const spine_player_evt& pe, spine_player& p) { + owner.for_joined_components([ + ](ecs::entity e, const spine_player_evt& pe) { for ( const auto& evt : pe.events() ) { if ( auto complete_evt = std::get_if(&evt); complete_evt && complete_evt->message() == "to_walk" ) diff --git a/sources/3rdparty/bass/linux/bass.h b/sources/3rdparty/bass/linux/bass.h index 388d4068..e3bf8dcc 100644 --- a/sources/3rdparty/bass/linux/bass.h +++ b/sources/3rdparty/bass/linux/bass.h @@ -724,7 +724,7 @@ typedef struct { BYTE Reserved[190]; #if defined(__GNUC__) && __GNUC__<3 char CodingHistory[0]; // history -#elif 1 // change to 0 if compiler fails the following line +#elif 0 // change to 0 if compiler fails the following line char CodingHistory[]; // history #else char CodingHistory[1]; // history @@ -762,7 +762,7 @@ typedef struct char URL[1024]; // uniform resource locator #if defined(__GNUC__) && __GNUC__<3 char TagText[0]; // free form text for scripts or tags -#elif 1 // change to 0 if compiler fails the following line +#elif 0 // change to 0 if compiler fails the following line char TagText[]; // free form text for scripts or tags #else char TagText[1]; // free form text for scripts or tags @@ -785,7 +785,7 @@ typedef struct DWORD dwCuePoints; #if defined(__GNUC__) && __GNUC__<3 TAG_CUE_POINT CuePoints[0]; -#elif 1 // change to 0 if compiler fails the following line +#elif 0 // change to 0 if compiler fails the following line TAG_CUE_POINT CuePoints[]; #else TAG_CUE_POINT CuePoints[1]; @@ -816,7 +816,7 @@ typedef struct DWORD cbSamplerData; #if defined(__GNUC__) && __GNUC__<3 TAG_SMPL_LOOP SampleLoops[0]; -#elif 1 // change to 0 if compiler fails the following line +#elif 0 // change to 0 if compiler fails the following line TAG_SMPL_LOOP SampleLoops[]; #else TAG_SMPL_LOOP SampleLoops[1]; diff --git a/sources/3rdparty/bass/windows/bass.h b/sources/3rdparty/bass/windows/bass.h index 388d4068..e3bf8dcc 100644 --- a/sources/3rdparty/bass/windows/bass.h +++ b/sources/3rdparty/bass/windows/bass.h @@ -724,7 +724,7 @@ typedef struct { BYTE Reserved[190]; #if defined(__GNUC__) && __GNUC__<3 char CodingHistory[0]; // history -#elif 1 // change to 0 if compiler fails the following line +#elif 0 // change to 0 if compiler fails the following line char CodingHistory[]; // history #else char CodingHistory[1]; // history @@ -762,7 +762,7 @@ typedef struct char URL[1024]; // uniform resource locator #if defined(__GNUC__) && __GNUC__<3 char TagText[0]; // free form text for scripts or tags -#elif 1 // change to 0 if compiler fails the following line +#elif 0 // change to 0 if compiler fails the following line char TagText[]; // free form text for scripts or tags #else char TagText[1]; // free form text for scripts or tags @@ -785,7 +785,7 @@ typedef struct DWORD dwCuePoints; #if defined(__GNUC__) && __GNUC__<3 TAG_CUE_POINT CuePoints[0]; -#elif 1 // change to 0 if compiler fails the following line +#elif 0 // change to 0 if compiler fails the following line TAG_CUE_POINT CuePoints[]; #else TAG_CUE_POINT CuePoints[1]; @@ -816,7 +816,7 @@ typedef struct DWORD cbSamplerData; #if defined(__GNUC__) && __GNUC__<3 TAG_SMPL_LOOP SampleLoops[0]; -#elif 1 // change to 0 if compiler fails the following line +#elif 0 // change to 0 if compiler fails the following line TAG_SMPL_LOOP SampleLoops[]; #else TAG_SMPL_LOOP SampleLoops[1]; diff --git a/sources/enduro2d/core/render_impl/render_opengl.cpp b/sources/enduro2d/core/render_impl/render_opengl.cpp index aeab0126..8cb6410f 100644 --- a/sources/enduro2d/core/render_impl/render_opengl.cpp +++ b/sources/enduro2d/core/render_impl/render_opengl.cpp @@ -1100,6 +1100,7 @@ namespace e2d if ( tex->decl().is_compressed() ) { const v2u block_size = tex->decl().block_size(); + E2D_UNUSED(block_size); E2D_ASSERT(region.position.x % block_size.x == 0 && region.position.y % block_size.y == 0); E2D_ASSERT(region.size.x % block_size.x == 0 && region.size.y % block_size.y == 0); opengl::with_gl_bind_texture(state_->dbg(), tex->state().id(), diff --git a/untests/sources/untests_utils/intrusive_ptr.cpp b/untests/sources/untests_utils/intrusive_ptr.cpp index d460d6e1..03cc6551 100644 --- a/untests/sources/untests_utils/intrusive_ptr.cpp +++ b/untests/sources/untests_utils/intrusive_ptr.cpp @@ -231,7 +231,7 @@ TEST_CASE("intrusive_ptr") { REQUIRE(obj_t::dtor_counter == 4u); } { - std::make_unique(10); + E2D_UNUSED(std::make_unique(10)); intrusive_ptr p1(new derived2_t()); intrusive_ptr p2 = static_pointer_cast(p1); REQUIRE(p2->i == 21);