Skip to content

Commit

Permalink
Clean up some warnings when enabling dev checks
Browse files Browse the repository at this point in the history
  • Loading branch information
shravanrn committed Sep 5, 2024
1 parent f2111c0 commit 194032b
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
@@ -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: '*'
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion include/rlbox_wasm2c_tls.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once

// IWYU pragma: private, include "rlbox_wasm2c_sandbox.hpp"
#include <stdint.h>

namespace rlbox {
Expand Down
4 changes: 2 additions & 2 deletions test/test_wasm2c_sandbox_glue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions test/test_wasm2c_sandbox_glue_embedder_vars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/test_wasm2c_sandbox_glue_main.cpp
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#define CATCH_CONFIG_MAIN
#include "catch2/catch.hpp"
#include "catch2/catch.hpp" // IWYU pragma: keep
2 changes: 1 addition & 1 deletion test/test_wasm2c_sandbox_glue_shadow.cpp
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
4 changes: 2 additions & 2 deletions test/test_wasm2c_sandbox_glue_smallheap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 194032b

Please sign in to comment.