Skip to content

Commit 77a766e

Browse files
committed
Give up on array-bounds warnings with GCC
1 parent 89ca331 commit 77a766e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ function(set_compiler_flags_for_target target)
3737
if(MSVC_VERSION GREATER_EQUAL 1920) #VS 2019 and above
3838
target_compile_options(${target} PRIVATE /W4 /WX)
3939
endif()
40+
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
41+
target_compile_options(${target} PRIVATE -Wall -Wextra -Wpedantic -Werror -Wno-array-bounds)
4042
else()
4143
target_compile_options(${target} PRIVATE -Wall -Wextra -Wpedantic -Werror)
4244
endif()

include/json_struct/json_struct.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3783,9 +3783,10 @@ struct JsonStructFunctionContainerDummy
37833783
#define JS_FUNCTION_CONTAINER_EXTERNAL_WITH_SUPER_WITHOUT_MEMBERS(Type, super_list) \
37843784
JS_FUNCTION_CONTAINER_EXTERNAL_INTERNAL_IMPL(Type, super_list, JS::makeTuple())
37853785

3786-
#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ == 11
3786+
#if !defined(__clang__) && defined(__GNUC__)
37873787
#pragma GCC diagnostic push
37883788
#pragma GCC diagnostic ignored "-Warray-bounds"
3789+
#pragma GCC diagnostic ignored "-Wstringop-overflow"
37893790
#endif
37903791

37913792
namespace Internal
@@ -4019,7 +4020,7 @@ struct FunctionCaller<T, U, void, void, NAME_COUNT, 2>
40194020
};
40204021
} // namespace Internal
40214022

4022-
#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ == 11
4023+
#if !defined(__clang__) && defined(__GNUC__)
40234024
#pragma GCC diagnostic pop
40244025
#endif
40254026

0 commit comments

Comments
 (0)