Skip to content

Commit

Permalink
WIP: fix or silence more warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
pablode committed Jul 29, 2024
1 parent 91bd59b commit b6230b5
Show file tree
Hide file tree
Showing 31 changed files with 134 additions and 11 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Validation Build

on:
push:
branches:
- 'master'
- 'dev'
# branches:
# - 'master'
# - 'dev'
paths-ignore:
- '**.md'
- '**.glsl'
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)

include(CMakeDependentOption)

Expand Down
17 changes: 17 additions & 0 deletions cmake/BuildConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,20 @@ set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING "Choose the type of buil

# Append list of configs for multi-output generators like VS
list(APPEND CMAKE_CONFIGURATION_TYPES "Develop")


# TODO: define GTL_COMPILE_OPTIONS that is then manually set for each target
# TODO: define GTL_LINK_OPTIONS -> target_link_options (CMake 3.13). e.g. warnings as errors?
if(MSVC)
set(GTL_COMPILE_OPTIONS "")#"/Wall")
# Disable "not enough arguments for function-like macro invocation" warning caused
# by the transitive inclusion of boost headers and non-conformant MSVC preprocessor
# behaviour. See USD's msvcdefaults.cmake file for a detailed comment.
set(GTL_COMPILE_OPTIONS "${GTL_COMPILE_OPTIONS}" "/wd4003")
else()
set(GTL_COMPILE_OPTIONS "-Wall" "-Wextra" "-Wformat-security")
endif()

# TODO: for headers, either use a #pragma OR in case of USD/pxr, add to the target additionally


1 change: 1 addition & 0 deletions extern/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ set(OPENEXR_INSTALL OFF)
set(OPENEXR_INSTALL_TOOLS OFF)
set(OPENEXR_INSTALL_EXAMPLES OFF)
add_subdirectory(openexr)
target_compile_options(OpenEXR PRIVATE "-Wno-#warnings")

#
# stb
Expand Down
2 changes: 1 addition & 1 deletion extern/efsw
Submodule efsw updated 43 files
+170 −0 .ecode/project_build.json
+5 −0 .gitignore
+20 −26 CMakeLists.txt
+4 −0 README.md
+16 −0 compile_flags.txt
+3 −0 efswConfig.cmake.in
+33 −4 include/efsw/efsw.h
+52 −5 include/efsw/efsw.hpp
+2 −7 premake4.lua
+1 −6 premake5.lua
+1 −1 project/qtcreator-linux/efsw.cflags
+29 −20 project/qtcreator-linux/efsw.creator.user
+1 −1 project/qtcreator-linux/efsw.cxxflags
+0 −18 src/efsw/Atomic.hpp
+2 −2 src/efsw/DirectorySnapshot.cpp
+3 −3 src/efsw/FileInfo.hpp
+24 −6 src/efsw/FileSystem.cpp
+8 −7 src/efsw/FileWatcher.cpp
+19 −1 src/efsw/FileWatcherCWrapper.cpp
+7 −66 src/efsw/FileWatcherFSEvents.cpp
+9 −21 src/efsw/FileWatcherFSEvents.hpp
+5 −3 src/efsw/FileWatcherGeneric.cpp
+10 −9 src/efsw/FileWatcherGeneric.hpp
+11 −0 src/efsw/FileWatcherImpl.cpp
+9 −2 src/efsw/FileWatcherImpl.hpp
+32 −77 src/efsw/FileWatcherInotify.cpp
+11 −7 src/efsw/FileWatcherInotify.hpp
+5 −3 src/efsw/FileWatcherKqueue.cpp
+9 −8 src/efsw/FileWatcherKqueue.hpp
+13 −8 src/efsw/FileWatcherWin32.cpp
+8 −7 src/efsw/FileWatcherWin32.hpp
+17 −2 src/efsw/Log.cpp
+10 −18 src/efsw/WatcherFSEvents.cpp
+0 −4 src/efsw/WatcherFSEvents.hpp
+1 −1 src/efsw/WatcherGeneric.hpp
+0 −4 src/efsw/WatcherInotify.cpp
+0 −3 src/efsw/WatcherInotify.hpp
+4 −8 src/efsw/WatcherKqueue.cpp
+1 −1 src/efsw/WatcherKqueue.hpp
+27 −9 src/efsw/WatcherWin32.cpp
+9 −9 src/efsw/WatcherWin32.hpp
+164 −0 src/test/efsw-test.c
+2 −1 src/test/efsw-test.cpp
6 changes: 6 additions & 0 deletions src/cgpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ target_link_libraries(
spirv-reflect-static
)

target_compile_options(
cgpu
PRIVATE
${GTL_COMPILE_OPTIONS}
)

set_target_properties(
cgpu
PROPERTIES
Expand Down
3 changes: 3 additions & 0 deletions src/cgpu/impl/Cgpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-variable"
#pragma clang diagnostic ignored "-Wunused-parameter"
#pragma clang diagnostic ignored "-Wmissing-field-initializers"
// Silence nullability log spam on AppleClang
#pragma clang diagnostic ignored "-Wnullability-completeness"
#endif
Expand Down
6 changes: 6 additions & 0 deletions src/gb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ target_link_libraries(
quill
)

target_compile_options(
gb
PRIVATE
${GTL_COMPILE_OPTIONS}
)

if(GTL_VERBOSE)
target_compile_definitions(gb PUBLIC GTL_VERBOSE=1)
endif()
Expand Down
6 changes: 6 additions & 0 deletions src/ggpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ target_link_libraries(
cgpu
)

target_compile_options(
ggpu
PRIVATE
${GTL_COMPILE_OPTIONS}
)

set_target_properties(
ggpu
PROPERTIES
Expand Down
2 changes: 1 addition & 1 deletion src/ggpu/impl/SyncBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace gtl
assert(m_updateStrategy == UpdateStrategy::PersistentMapping || m_deviceBuffer.size() == 0);
}

uint8_t* GgpuSyncBuffer::read(uint64_t byteOffset, uint64_t byteSize)
uint8_t* GgpuSyncBuffer::read(uint64_t byteOffset, [[maybe_unused]] uint64_t byteSize) // TODO: remove byteSize?
{
assert((byteOffset + byteSize) <= m_size);
return &m_mappedHostMem[byteOffset];
Expand Down
6 changes: 6 additions & 0 deletions src/gi/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ function(configure_target TARGET)
SPIRV
)

target_compile_options(
${TARGET}
PRIVATE
${GTL_COMPILE_OPTIONS}
)

if(OpenMP_CXX_FOUND)
target_link_libraries(${TARGET} PRIVATE OpenMP::OpenMP_CXX)
endif()
Expand Down
2 changes: 1 addition & 1 deletion src/gi/impl/Gi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2008,7 +2008,7 @@ namespace gtl
return light;
}

void giDestroyDomeLight(GiScene* scene, GiDomeLight* light)
void giDestroyDomeLight([[maybe_unused]]/*TODO:use?*/ GiScene* scene, GiDomeLight* light)
{
delete light;
}
Expand Down
2 changes: 1 addition & 1 deletion src/gi/impl/GlslShaderGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ namespace gtl

bool _MakeMaterialGenInfo(const McGlslGenResult& codeGenResult,
const std::string& resourcePathPrefix,
fs::path shaderPath,
[[maybe_unused]] fs::path shaderPath, // TODO: remove?
GiGlslShaderGen::MaterialGenInfo& genInfo)
{
// Append resource path prefix for file-backed MDL modules.
Expand Down
6 changes: 6 additions & 0 deletions src/gt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ target_link_libraries(
PRIVATE
gb
)

target_compile_options(
gt
PRIVATE
${GTL_COMPILE_OPTIONS}
)
6 changes: 6 additions & 0 deletions src/hdGatling/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ target_compile_definitions(
"$<$<OR:$<CONFIG:>,$<CONFIG:Debug>>:TBB_USE_DEBUG>"
)

target_compile_options(
hdGatling
PRIVATE
${GTL_COMPILE_OPTIONS}
)

# Workaround for https://github.com/PixarAnimationStudios/USD/issues/1279
if(MSVC_VERSION GREATER_EQUAL 1920)
target_compile_options(hdGatling PRIVATE "/Zc:inline-")
Expand Down
3 changes: 2 additions & 1 deletion src/hdGatling/light.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ PXR_NAMESPACE_OPEN_SCOPE

namespace
{
float _AreaEllipsoid(const GfMatrix4d& t, float radiusX, float radiusY, float radiusZ)
//TODO: use transform or remove
float _AreaEllipsoid([[maybe_unused]] const GfMatrix4d& t, float radiusX, float radiusY, float radiusZ)
{
float ab = powf(radiusX * radiusY, 1.6f);
float ac = powf(radiusX * radiusZ, 1.6f);
Expand Down
2 changes: 1 addition & 1 deletion src/hdGatling/mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ namespace
bitangent = GfVec3f(b, nSign + n[1] * n[1] * a, -n[1]);
}

void _CalculateFallbackTangents(const VtVec3iArray& meshFaces,
void _CalculateFallbackTangents([[maybe_unused]] const VtVec3iArray& meshFaces, // TODO: remove
const _VertexAttr<GfVec3f>& meshNormals,
VtVec3fArray& meshTangents,
VtFloatArray& meshBitangentSigns)
Expand Down
2 changes: 1 addition & 1 deletion src/hdGatling/renderPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ bool HdGatlingRenderPass::IsConverged() const
}

void HdGatlingRenderPass::_BakeMeshes(HdRenderIndex* renderIndex,
GfMatrix4d rootTransform,
[[maybe_unused]] GfMatrix4d rootTransform, // TODO: remove
std::vector<const GiMaterial*>& materials,
std::vector<const GiMesh*>& meshes,
std::vector<GiMeshInstance>& instances)
Expand Down
6 changes: 6 additions & 0 deletions src/imgio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,9 @@ target_link_libraries(
OpenEXR::OpenEXR
stb
)

target_compile_options(
imgio
PRIVATE
${GTL_COMPILE_OPTIONS}
)
3 changes: 3 additions & 0 deletions src/imgio/impl/ExrDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@
#include "ErrorCodes.h"
#include "Image.h"

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-parameter"
#include <ImfRgbaFile.h>
#include <ImfIO.h>
#include <ImfArray.h>
#include <ImfRgba.h>
#pragma clang diagnostic pop

#include <algorithm>
#include <assert.h>
Expand Down
4 changes: 4 additions & 0 deletions src/imgio/impl/HdrDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@
#include "ErrorCodes.h"
#include "Image.h"

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-parameter"
#pragma clang diagnostic ignored "-Wunused-function"
#define STB_IMAGE_IMPLEMENTATION
#define STBI_FAILURE_USERMSG
#define STBI_ONLY_HDR
#include <stb_image.h>
#pragma clang diagnostic pop

#include <algorithm>
#include <float.h>
Expand Down
6 changes: 6 additions & 0 deletions src/mc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ target_link_libraries(
MaterialXGenMdl
)

target_compile_options(
mc
PRIVATE
${GTL_COMPILE_OPTIONS}
)

if(DEFINED PXR_VERSION)
target_compile_definitions(
mc
Expand Down
7 changes: 7 additions & 0 deletions src/mc/impl/Backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@

#include "Backend.h"

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-copy"
#pragma clang diagnostic ignored "-Wunused-variable"
#pragma clang diagnostic ignored "-Wunused-parameter"
#pragma clang diagnostic ignored "-Wunused-function"
#pragma clang diagnostic ignored "-Wsign-compare"
#include <mi/mdl_sdk.h>
#pragma clang diagnostic pop

#include <cassert>
#include <array>
Expand Down
6 changes: 6 additions & 0 deletions src/mc/impl/MdlLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@

#include "MdlLogger.h"

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-copy"
#pragma clang diagnostic ignored "-Wunused-variable"
#pragma clang diagnostic ignored "-Wunused-parameter"
#pragma clang diagnostic ignored "-Wunused-function"
#include <mi/mdl_sdk.h>
#pragma clang diagnostic pop

#include <stdio.h>
#include <gtl/gb/Log.h>
Expand Down
6 changes: 6 additions & 0 deletions src/mc/impl/MdlLogger.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@

#pragma once

#pragma clang diagnostic push
//#pragma clang diagnostic ignored "-Wdeprecated-copy"
//#pragma clang diagnostic ignored "-Wunused-variable"
#pragma clang diagnostic ignored "-Wunused-parameter"
#pragma clang diagnostic ignored "-Wunused-function"
#include <mi/base/interface_implement.h>
#include <mi/base/ilogger.h>
#include <mi/neuraylib/imdl_execution_context.h>
#pragma clang diagnostic pop

namespace gtl
{
Expand Down
5 changes: 5 additions & 0 deletions src/mc/impl/MdlMaterialCompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@

#include <gtl/gb/Fmt.h>

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-copy"
#pragma clang diagnostic ignored "-Wunused-parameter"
#pragma clang diagnostic ignored "-Wunused-function"
#include <mi/mdl_sdk.h>
#pragma clang diagnostic pop

#include <atomic>
#include <cassert>
Expand Down
5 changes: 5 additions & 0 deletions src/mc/impl/MdlMaterialCompiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
#include <vector>
#include <mutex>

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-copy"
#pragma clang diagnostic ignored "-Wunused-parameter"
#pragma clang diagnostic ignored "-Wunused-function"
#include <mi/base/handle.h>
#include <mi/neuraylib/icompiled_material.h>
#include <mi/neuraylib/idatabase.h>
Expand All @@ -31,6 +35,7 @@
#include <mi/neuraylib/imdl_execution_context.h>
#include <mi/neuraylib/imdl_factory.h>
#include <mi/neuraylib/imdl_impexp_api.h>
#pragma clang diagnostic pop

#include "MdlLogger.h"

Expand Down
5 changes: 5 additions & 0 deletions src/mc/impl/MdlNeurayLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@

#include "MdlNeurayLoader.h"

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-copy"
#pragma clang diagnostic ignored "-Wunused-parameter"
#pragma clang diagnostic ignored "-Wunused-function"
#include <mi/mdl_sdk.h>
#pragma clang diagnostic pop

#ifdef MI_PLATFORM_WINDOWS
#include <mi/base/miwindows.h>
Expand Down
4 changes: 4 additions & 0 deletions src/mc/impl/MdlNeurayLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@

#pragma once

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-parameter"
#pragma clang diagnostic ignored "-Wunused-function"
#include <mi/base/handle.h>
#include <mi/neuraylib/ineuray.h>
#pragma clang diagnostic pop

#include <string_view>

Expand Down
3 changes: 3 additions & 0 deletions src/mc/impl/MdlRuntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
#include "MdlLogger.h"
#include "MdlNeurayLoader.h"

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-copy"
#include <mi/mdl_sdk.h>
#pragma clang diagnostic pop

namespace gtl
{
Expand Down
5 changes: 5 additions & 0 deletions src/mc/impl/MdlRuntime.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@

#pragma once

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-copy"
#pragma clang diagnostic ignored "-Wunused-parameter"
#pragma clang diagnostic ignored "-Wunused-function"
#include <mi/base/handle.h>
#include <mi/neuraylib/ineuray.h>
#include <mi/neuraylib/idatabase.h>
Expand All @@ -25,6 +29,7 @@
#include <mi/neuraylib/imdl_backend_api.h>
#include <mi/neuraylib/imdl_impexp_api.h>
#include <mi/neuraylib/imdl_factory.h>
#pragma clang diagnostic pop

#include <memory>
#include <string_view>
Expand Down

0 comments on commit b6230b5

Please sign in to comment.