diff --git a/.clang-tidy b/.clang-tidy index 9132fc7..a391382 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,3 +1,3 @@ -Checks: '*,-llvmlibc-*,-modernize-use-trailing-return-type,-cppcoreguidelines-macro-usage,-cppcoreguidelines-avoid-non-const-global-variables' +Checks: '*,-llvmlibc-*,-modernize-use-trailing-return-type,-cppcoreguidelines-macro-usage,-cppcoreguidelines-avoid-non-const-global-variables,-bugprone-macro-parentheses' HeaderFilterRegex: '*' WarningsAsErrors: '*' \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 296d4ef..c4fff67 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -231,8 +231,12 @@ add_custom_command(OUTPUT "${GLUE_LIB_EXPORTED_H}" "${GLUE_LIB_EXPORTED_C}" "${G # Tests ################### if(DEV) - add_compile_options(-Wall -Wextra -pedantic ${RLBOX_SANITIZER_COMPILE_FLAGS}) - add_link_options(${RLBOX_SANITIZER_LINK_FLAGS}) + if(NOT MSVC) + add_compile_options(-Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers ${RLBOX_SANITIZER_COMPILE_FLAGS}) + set_source_files_properties(${GLUE_LIB_IMPORTED_C} PROPERTIES COMPILE_OPTIONS "-Wno-cast-function-type;-Wno-unused-function;-Wno-unused-value;-Wno-unused-but-set-variable") + set_source_files_properties(${GLUE_LIB_EXPORTED_C} PROPERTIES COMPILE_OPTIONS "-Wno-cast-function-type;-Wno-unused-function;-Wno-unused-value;-Wno-unused-but-set-variable") + add_link_options(${RLBOX_SANITIZER_LINK_FLAGS}) + endif() endif() set(WASM2C_RUNTIME_CODE ${WASM2C_RUNTIME_SOURCE_DIR}/wasm-rt-impl.c diff --git a/include/rlbox_wasm2c_tls.hpp b/include/rlbox_wasm2c_tls.hpp index b87ac7b..e133245 100644 --- a/include/rlbox_wasm2c_tls.hpp +++ b/include/rlbox_wasm2c_tls.hpp @@ -1,5 +1,5 @@ #pragma once - +// IWYU pragma: private, include "rlbox_wasm2c_sandbox.hpp" #include namespace rlbox { diff --git a/test/test_wasm2c_sandbox_glue.cpp b/test/test_wasm2c_sandbox_glue.cpp index 69a68ff..b07ebf1 100755 --- a/test/test_wasm2c_sandbox_glue.cpp +++ b/test/test_wasm2c_sandbox_glue.cpp @@ -3,8 +3,8 @@ #define RLBOX_SINGLE_THREADED_INVOCATIONS #define RLBOX_USE_STATIC_CALLS() rlbox_wasm2c_sandbox_lookup_symbol #define RLBOX_WASM2C_MODULE_NAME glue__lib__wasm2c -#include "glue_lib_wasm2c.h" -#include "rlbox_wasm2c_sandbox.hpp" +#include "glue_lib_wasm2c.h" // IWYU pragma: keep +#include "rlbox_wasm2c_sandbox.hpp" // IWYU pragma: keep // NOLINTNEXTLINE #define TestName "rlbox_wasm2c_sandbox static" diff --git a/test/test_wasm2c_sandbox_glue_embedder_vars.cpp b/test/test_wasm2c_sandbox_glue_embedder_vars.cpp index e3a771e..765821d 100755 --- a/test/test_wasm2c_sandbox_glue_embedder_vars.cpp +++ b/test/test_wasm2c_sandbox_glue_embedder_vars.cpp @@ -4,8 +4,8 @@ #define RLBOX_USE_STATIC_CALLS() rlbox_wasm2c_sandbox_lookup_symbol #define RLBOX_WASM2C_MODULE_NAME glue__lib__wasm2c #define RLBOX_EMBEDDER_PROVIDES_TLS_STATIC_VARIABLES -#include "glue_lib_wasm2c.h" -#include "rlbox_wasm2c_sandbox.hpp" +#include "glue_lib_wasm2c.h" // IWYU pragma: keep +#include "rlbox_wasm2c_sandbox.hpp" // IWYU pragma: keep RLBOX_WASM2C_SANDBOX_STATIC_VARIABLES(); // NOLINTNEXTLINE diff --git a/test/test_wasm2c_sandbox_glue_main.cpp b/test/test_wasm2c_sandbox_glue_main.cpp index 62bf747..fcb91ba 100755 --- a/test/test_wasm2c_sandbox_glue_main.cpp +++ b/test/test_wasm2c_sandbox_glue_main.cpp @@ -1,2 +1,2 @@ #define CATCH_CONFIG_MAIN -#include "catch2/catch.hpp" +#include "catch2/catch.hpp" // IWYU pragma: keep diff --git a/test/test_wasm2c_sandbox_glue_shadow.cpp b/test/test_wasm2c_sandbox_glue_shadow.cpp index ed110f3..a131f7e 100755 --- a/test/test_wasm2c_sandbox_glue_shadow.cpp +++ b/test/test_wasm2c_sandbox_glue_shadow.cpp @@ -1,7 +1,7 @@ #define RLBOX_USE_EXCEPTIONS #define RLBOX_ENABLE_DEBUG_ASSERTIONS #define RLBOX_SINGLE_THREADED_INVOCATIONS -#include "rlbox_wasm2c_sandbox.hpp" +#include "rlbox_wasm2c_sandbox.hpp" // IWYU pragma: keep // NOLINTNEXTLINE #define TestName "rlbox_wasm2c_sandbox shadow" diff --git a/test/test_wasm2c_sandbox_glue_smallheap.cpp b/test/test_wasm2c_sandbox_glue_smallheap.cpp index c87b4cc..ec22fc8 100755 --- a/test/test_wasm2c_sandbox_glue_smallheap.cpp +++ b/test/test_wasm2c_sandbox_glue_smallheap.cpp @@ -3,8 +3,8 @@ #define RLBOX_SINGLE_THREADED_INVOCATIONS #define RLBOX_USE_STATIC_CALLS() rlbox_wasm2c_sandbox_lookup_symbol #define RLBOX_WASM2C_MODULE_NAME glue__lib__wasm2c -#include "glue_lib_wasm2c.h" -#include "rlbox_wasm2c_sandbox.hpp" +#include "glue_lib_wasm2c.h" // IWYU pragma: keep +#include "rlbox_wasm2c_sandbox.hpp" // IWYU pragma: keep // NOLINTNEXTLINE #define TestName "rlbox_wasm2c_sandbox smallheap"