Build with pedantically standard C++ (#1309)

* Remove array designators (not standard C++)

* Build with pedantically standard C++
This commit is contained in:
Sylvie
2024-02-23 16:46:53 -05:00
committed by GitHub
parent c0d534f5ad
commit 54d6a22d19
10 changed files with 63 additions and 68 deletions

View File

@@ -33,10 +33,11 @@ if(MSVC)
add_link_options(${SAN_FLAGS})
endif()
else()
# TODO: use -pedantic after non-C++ idioms are gone
add_compile_options(-Wall)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_compile_options(-Wno-c99-designator)
add_compile_options(-Wall -pedantic)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# C++20 allows macros to take zero variadic arguments, but Clang (aka AppleClang on macOS)
# does not recognize this yet.
add_compile_options(-Wno-gnu-zero-variadic-macro-arguments)
endif()
add_definitions(-D_POSIX_C_SOURCE=200809L)
if(SANITIZERS)