Reformat some long warning-flag-setting lines

This commit is contained in:
ISSOtm
2026-03-09 02:17:51 -04:00
committed by Rangi
parent dc5fc9f327
commit b56b56a695

View File

@@ -24,12 +24,13 @@ option(SANITIZERS "Build with sanitizers enabled" OFF)
cmake_dependent_option(MORE_WARNINGS "Turn on more warnings" OFF !MSVC OFF) cmake_dependent_option(MORE_WARNINGS "Turn on more warnings" OFF !MSVC OFF)
if(MSVC) if(MSVC)
# MSVC's own standard library triggers warning C5105, add_compile_options(
# "macro expansion producing 'defined' has undefined behavior". /MP # Build multiple files in parallel.
# Warning C5030 is about unknown attributes (`[[gnu::ATTR]]`), none of ours being load-bearing. /wd5105 # MSVC's own standard library triggers warning C5105, "macro expansion producing 'defined' has undefined behavior".
# Warning C4996 is about using POSIX names, which we want to do for portability. /wd5030 # Warning C5030 is about unknown attributes (`[[gnu::ATTR]]`), none of ours being load-bearing.
# We also opt into the C++20-conformant preprocessor. /wd4996 # Warning C4996 is about using POSIX names, which we want to do for portability.
add_compile_options(/MP /wd5105 /wd5030 /wd4996 /Zc:preprocessor) /Zc:preprocessor # Opt into the C++20-conformant preprocessor.
)
add_definitions(/D_CRT_SECURE_NO_WARNINGS) add_definitions(/D_CRT_SECURE_NO_WARNINGS)
if(SANITIZERS) if(SANITIZERS)
@@ -39,12 +40,10 @@ if(MSVC)
add_link_options(${SAN_FLAGS}) add_link_options(${SAN_FLAGS})
endif() endif()
else() else()
add_compile_options(-Wall -pedantic) add_compile_options(-Wall -pedantic
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") # C++20 allows macros to take zero variadic arguments.
# C++20 allows macros to take zero variadic arguments, but Clang (aka AppleClang on macOS) # Some versions of Clang don't recognize this, and treat them as a GNU extension.
# does not recognize this yet. -Wno-gnu-zero-variadic-macro-arguments)
add_compile_options(-Wno-gnu-zero-variadic-macro-arguments)
endif()
if(SANITIZERS) if(SANITIZERS)
message(STATUS "ASan and UBSan enabled") message(STATUS "ASan and UBSan enabled")
set(SAN_FLAGS -fsanitize=address -fsanitize=undefined set(SAN_FLAGS -fsanitize=address -fsanitize=undefined