Skip to content

Commit ef4023d

Browse files
committed
silence GCC warnings
1 parent 043a4a7 commit ef4023d

4 files changed

Lines changed: 18 additions & 9 deletions

File tree

CMakeLists.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,13 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
8282
-Wwrite-strings
8383
-Winit-self
8484
-Wreturn-type
85-
-Wreorder
86-
-Werror=delete-non-virtual-dtor
85+
$<$<COMPILE_LANGUAGE:CXX>:-Wreorder>
86+
$<$<COMPILE_LANGUAGE:CXX>:-Werror=delete-non-virtual-dtor>
8787
-Werror
88-
#uncomment this to stop the compilation at the first error
88+
89+
# some GCC versions have bugs triggering this warning
90+
-Wno-stringop-overflow
91+
#uncomment this to stop the compilation at the first error
8992
# -Wfatal-errors
9093
)
9194
endif()

Editor/Editor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include "DummyVisualizer.h"
88

99
// some application parameters can be overwritten in the executable by finding the 256 byte long pattern in the first member:
10-
extern ApplicationExeCustomization exe_customization = {
10+
ApplicationExeCustomization exe_customization = {
1111
"Wicked Editor ",
1212
wi::Color(130, 210, 220, 255),
1313
wi::Color(17, 30, 43, 255)

Editor/ModelImporter_GLTF.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2227,7 +2227,7 @@ void Import_Extension_VRM(LoaderState& state)
22272227
for (size_t boneGroup_index = 0; boneGroup_index < boneGroups.ArrayLen(); ++boneGroup_index)
22282228
{
22292229
const auto& boneGroup = boneGroups.Get(int(boneGroup_index));
2230-
SpringComponent component;
2230+
SpringComponent component{};
22312231

22322232
if (boneGroup.Has("dragForce"))
22332233
{
@@ -2966,7 +2966,7 @@ void Import_Extension_VRMC(LoaderState& state)
29662966
for (size_t joint_index = 0; joint_index < joints.ArrayLen(); ++joint_index)
29672967
{
29682968
const auto& joint = joints.Get(int(joint_index));
2969-
SpringComponent component;
2969+
SpringComponent component{};
29702970
//component.colliders = colliderIDs; // for now, we will just use all colliders in the scene for every spring
29712971

29722972
if (joint.Has("dragForce"))
@@ -4767,7 +4767,7 @@ void ExportModel_GLTF(const std::string& filename, Scene& scene)
47674767

47684768
// Build accessors
47694769

4770-
size_t morph_pos_accessor_index;
4770+
size_t morph_pos_accessor_index = -1;
47714771
if(buf_d_morph_pos_size > 0)
47724772
{
47734773
// Sparse accessor indices
@@ -4812,7 +4812,7 @@ void ExportModel_GLTF(const std::string& filename, Scene& scene)
48124812
state.gltfModel.accessors.push_back(morph_pos_accessor_builder);
48134813
}
48144814

4815-
size_t morph_norm_accessor_index;
4815+
size_t morph_norm_accessor_index = -1;
48164816
if(buf_d_morph_norm_size > 0)
48174817
{
48184818
// Sparse accessor indices

Editor/ModelImporter_OBJ.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@
22
#include "wiScene.h"
33
#include "ModelImporter.h"
44

5+
#ifdef __GNUC__
6+
#pragma GCC diagnostic push
7+
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
8+
#endif
59
#define TINYOBJLOADER_IMPLEMENTATION
610
#include "tiny_obj_loader.h"
7-
11+
#ifdef __GNUC__
12+
#pragma GCC diagnostic pop
13+
#endif
814
using namespace wi::graphics;
915
using namespace wi::scene;
1016
using namespace wi::ecs;

0 commit comments

Comments
 (0)