Skip to content

Commit a7bc975

Browse files
committed
fix: diable warning from third party code
1 parent 5fbb553 commit a7bc975

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

.clang-suppressions

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# .clang-suppression:
2+
# Suppress -Winvalid-offsetof warnings in SpiderMonkey
3+
[invalid-offsetof]
4+
src:*/spidermonkey-obj/*

.clang-tidy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Checks: >
1111
misc-unused-alias-decls,
1212
misc-unused-using-decls,
1313
-clang-analyzer-optin.core.EnumCastOutOfRange,
14+
-clang-analyzer-optin.cplusplus.UninitializedObject,
1415
-cppcoreguidelines-avoid-do-while,
1516
-cppcoreguidelines-avoid-c-arrays,
1617
-cppcoreguidelines-pro-type-reinterpret-cast,

cmake/compile-flags.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
set(WASI 1)
22
set(CMAKE_CXX_STANDARD 23)
3+
set(SUPP_FILE ${CMAKE_SOURCE_DIR}/.clang-suppressions)
34
add_compile_definitions("$<$<CONFIG:DEBUG>:DEBUG=1>")
45

56
list(APPEND CMAKE_EXE_LINKER_FLAGS
@@ -13,10 +14,11 @@ list(JOIN CMAKE_EXE_LINKER_FLAGS " " CMAKE_EXE_LINKER_FLAGS)
1314

1415
list(APPEND CMAKE_CXX_FLAGS
1516
-std=gnu++23 -Wall -Werror -Qunused-arguments
16-
-Wimplicit-fallthrough -Wno-unknown-warning-option -Wno-invalid-offsetof
17+
-Wimplicit-fallthrough -Wno-unknown-warning-option
1718
-fno-sized-deallocation -fno-aligned-new -mthread-model single
1819
-fPIC -fno-rtti -fno-exceptions -fno-math-errno -pipe
1920
-fno-omit-frame-pointer -funwind-tables -m32
21+
--warning-suppression-mappings=${SUPP_FILE}
2022
)
2123
list(JOIN CMAKE_CXX_FLAGS " " CMAKE_CXX_FLAGS)
2224

cmake/lint.cmake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ add_custom_target(clang-tidy
1515
-p=${CMAKE_BINARY_DIR}
1616
-clang-tidy-binary=${CLANG_TIDY}
1717
-extra-arg=--sysroot=${WASI_SYSROOT}
18-
-extra-arg=-isystem${CMAKE_BINARY_DIR}/spidermonkey-obj/dist/include
1918
-config-file=${CMAKE_SOURCE_DIR}/.clang-tidy
2019
${CMAKE_SOURCE_DIR}/builtins
2120
${CMAKE_SOURCE_DIR}/runtime
@@ -30,7 +29,6 @@ add_custom_target(clang-tidy-fix
3029
-clang-tidy-binary=${CLANG_TIDY}
3130
-clang-apply-replacements-binary=${CLANG_APPLY_REPLACEMENTS}
3231
-extra-arg=--sysroot=${WASI_SYSROOT}
33-
-extra-arg=-isystem${CMAKE_BINARY_DIR}/spidermonkey-obj/dist/include
3432
-config-file=${CMAKE_SOURCE_DIR}/.clang-tidy
3533
-fix
3634
${CMAKE_SOURCE_DIR}/builtins

0 commit comments

Comments
 (0)