From b277eac0363393488e4ba38b3d7d3f896e525bd7 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Mon, 9 Mar 2026 01:30:41 -0400 Subject: [PATCH 01/16] Properly specify our max CMake version supported Also bump it to the version I just tested it with --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 25852c02f..5a6e5c113 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ # 3.9 required for LTO checks # 3.17 optional for CMAKE_CTEST_ARGUMENTS -cmake_minimum_required(VERSION 3.9..3.17 FATAL_ERROR) +cmake_minimum_required(VERSION 3.9...4.2 FATAL_ERROR) project(rgbds LANGUAGES CXX) From f085a73bf80b087adee82eb675bd9a3a6c0cdc80 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Mon, 9 Mar 2026 01:50:19 -0400 Subject: [PATCH 02/16] Log with sanitizers are enabled under CMake This can help bring attention to the MSVC difference (no UBSan there) --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a6e5c113..e5bb743c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,7 @@ if(MSVC) add_definitions(/D_CRT_SECURE_NO_WARNINGS) if(SANITIZERS) + message(STATUS "ASan enabled") set(SAN_FLAGS /fsanitize=address) add_compile_options(${SAN_FLAGS}) add_link_options(${SAN_FLAGS}) @@ -45,6 +46,7 @@ else() add_compile_options(-Wno-gnu-zero-variadic-macro-arguments) endif() if(SANITIZERS) + message(STATUS "ASan and UBSan enabled") set(SAN_FLAGS -fsanitize=address -fsanitize=undefined -fsanitize=float-divide-by-zero) add_compile_options(${SAN_FLAGS}) From dc2f432d64905065c6cf6af316756a928d55230a Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Mon, 9 Mar 2026 01:50:45 -0400 Subject: [PATCH 03/16] Avoid showing the "more warnings" option for MSVC --- CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e5bb743c4..040b31098 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,8 +20,9 @@ if(srcdir STREQUAL bindir) message(FATAL_ERROR "Terminating configuration") endif() -option(SANITIZERS "Build with sanitizers enabled" OFF) # Ignored on MSVC -option(MORE_WARNINGS "Turn on more warnings" OFF) # Ignored on MSVC +include(CMakeDependentOption) +option(SANITIZERS "Build with sanitizers enabled" OFF) +cmake_dependent_option(MORE_WARNINGS "Turn on more warnings" OFF !MSVC OFF) if(MSVC) # MSVC's own standard library triggers warning C5105, From 9e98839c90eddffc8efcabcebef403e88a361e40 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Mon, 9 Mar 2026 02:02:54 -0400 Subject: [PATCH 04/16] Remove obsolete CMake version comment --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 040b31098..5e7060162 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,6 @@ # SPDX-License-Identifier: MIT # 3.9 required for LTO checks -# 3.17 optional for CMAKE_CTEST_ARGUMENTS cmake_minimum_required(VERSION 3.9...4.2 FATAL_ERROR) project(rgbds From 64626103e77de1cedb4767fab5b48b62b9a14ae6 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Mon, 9 Mar 2026 02:17:51 -0400 Subject: [PATCH 05/16] Reformat some long warning-flag-setting lines --- CMakeLists.txt | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e7060162..acddf23fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,12 +24,13 @@ option(SANITIZERS "Build with sanitizers enabled" OFF) cmake_dependent_option(MORE_WARNINGS "Turn on more warnings" OFF !MSVC OFF) if(MSVC) - # MSVC's own standard library triggers warning C5105, - # "macro expansion producing 'defined' has undefined behavior". - # Warning C5030 is about unknown attributes (`[[gnu::ATTR]]`), none of ours being load-bearing. - # Warning C4996 is about using POSIX names, which we want to do for portability. - # We also opt into the C++20-conformant preprocessor. - add_compile_options(/MP /wd5105 /wd5030 /wd4996 /Zc:preprocessor) + add_compile_options( + /MP # Build multiple files in parallel. + /wd5105 # MSVC's own standard library triggers warning C5105, "macro expansion producing 'defined' has undefined behavior". + /wd5030 # Warning C5030 is about unknown attributes (`[[gnu::ATTR]]`), none of ours being load-bearing. + /wd4996 # Warning C4996 is about using POSIX names, which we want to do for portability. + /Zc:preprocessor # Opt into the C++20-conformant preprocessor. + ) add_definitions(/D_CRT_SECURE_NO_WARNINGS) if(SANITIZERS) @@ -39,12 +40,10 @@ if(MSVC) add_link_options(${SAN_FLAGS}) endif() else() - 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_compile_options(-Wall -pedantic + # C++20 allows macros to take zero variadic arguments. + # Some versions of Clang don't recognize this, and treat them as a GNU extension. + -Wno-gnu-zero-variadic-macro-arguments) if(SANITIZERS) message(STATUS "ASan and UBSan enabled") set(SAN_FLAGS -fsanitize=address -fsanitize=undefined From e0838382435632934cb95962932eb4c3a8f3ca4b Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Mon, 9 Mar 2026 02:20:06 -0400 Subject: [PATCH 06/16] Correct minimum CMake version required Turns out the status messages use 3.17 --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index acddf23fb..fb4062d17 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ # SPDX-License-Identifier: MIT -# 3.9 required for LTO checks -cmake_minimum_required(VERSION 3.9...4.2 FATAL_ERROR) +# 3.17 required for LTO checks messages +cmake_minimum_required(VERSION 3.17...4.2 FATAL_ERROR) project(rgbds LANGUAGES CXX) From 59ecc718c58825968c0e70f36c33b88b64cffecb Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Mon, 9 Mar 2026 02:37:44 -0400 Subject: [PATCH 07/16] Ignore a CMake file that is not intended to be checked in --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index fdb7c9f83..e78169b0c 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ CMakeCache.txt CMakeFiles/ cmake_install.cmake +CMakeUserPresets.json build/ *.dSYM/ callgrind.out.* From 2a9ef902e681bbbd68f98bca36e6d9d9f726473c Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Mon, 9 Mar 2026 02:38:17 -0400 Subject: [PATCH 08/16] Add a few details to the project() call We can use them now that the minimum version has been bumped --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fb4062d17..4fc14e986 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,9 @@ cmake_minimum_required(VERSION 3.17...4.2 FATAL_ERROR) project(rgbds - LANGUAGES CXX) + LANGUAGES CXX + DESCRIPTION "Game Boy assembly toolchain" + HOMEPAGE_URL "https://rgbds.gbdev.io") include(CTest) From 9373e83b81783987e23dcf6c4044e103933227e6 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Mon, 9 Mar 2026 03:20:37 -0400 Subject: [PATCH 09/16] Use terser syntax for gb-starter-kit per-os check --- test/run-tests.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/run-tests.sh b/test/run-tests.sh index 495956e0f..f49e74360 100755 --- a/test/run-tests.sh +++ b/test/run-tests.sh @@ -134,6 +134,7 @@ test_downstream pinobatch libbet all libbet.gb f117089aa056600e2d404bbcbac test_downstream LIJI32 SameBoy bootroms build/bin/BootROMs/cgb_boot.bin 113903775a9d34b798c2f8076672da6626815a91 # gb-starter kit fails with any `make` on Windows: https://codeberg.org/ISSOtm/gb-starter-kit/issues/1 # gb-starter-kit fails with macOS/BSD `make`: https://codeberg.org/ISSOtm/gb-starter-kit/issues/29 -if [[ "${osname%-*}" != "windows" && "${osname%-*}" != "macos" && "${osname%-*}" != "bsd" ]]; then - test_downstream ISSOtm gb-starter-kit all bin/boilerplate.gb b4f130169ba73284e0d0e71b53e7baa4eca2f7fe -fi +case "${osname%%-*}" in + windows | macos | bsd) ;; + *) test_downstream ISSOtm gb-starter-kit all bin/boilerplate.gb b4f130169ba73284e0d0e71b53e7baa4eca2f7fe;; +esac From bbf12f797696232f511ed1062c7442d86d786438 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Mon, 9 Mar 2026 03:30:29 -0400 Subject: [PATCH 10/16] Fix uninialised CMake variables --- .github/workflows/testing.yml | 2 +- test/CMakeLists.txt | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index adfb18295..bdb165454 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -383,7 +383,7 @@ jobs: git \ png run: | # FreeBSD `c++` compiler does not support `make develop` sanitizers ASan or UBSan - cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=c++ -DUSE_EXTERNAL_TESTS=OFF -DOS=bsd + cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=c++ -DUSE_EXTERNAL_TESTS=OFF -DTESTS_OS_NAME=bsd cmake --build build -j4 --verbose cmake --install build --verbose cmake --build build --target test diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index b054f5861..d93311ecd 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -2,16 +2,11 @@ option(USE_NONFREE_TESTS "run tests that build nonfree codebases" ON) option(USE_EXTERNAL_TESTS "run tests that build external codebases" ON) +set(TESTS_OS_NAME "" CACHE STRING "skip running tests known to fail on this OS") -if(NOT USE_NONFREE_TESTS) - set(ONLY_FREE "--only-free") -endif() -if(NOT USE_EXTERNAL_TESTS) - set(ONLY_INTERNAL "--only-internal") -endif() -if(DEFINED OS) - set(OS_NAME "--os" "${OS}") -endif() +set(ONLY_FREE $,,--only-free>) +set(ONLY_INTERNAL $,,--only-internal>) +set(OS_NAME "$,,--os;${TESTS_OS_NAME}>") add_executable(randtilegen gfx/randtilegen.cpp) add_executable(rgbgfx_test gfx/rgbgfx_test.cpp) From 0a9e548eab321e20579ff42ae7270b822a21464c Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Mon, 9 Mar 2026 03:33:41 -0400 Subject: [PATCH 11/16] Document `run-tests.sh --os` Also switch to heredoc syntax for ease of editing --- test/fetch-test-deps.sh | 18 ++++++++++-------- test/run-tests.sh | 19 +++++++++++-------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/test/fetch-test-deps.sh b/test/fetch-test-deps.sh index 4cfcfae15..507446f9e 100755 --- a/test/fetch-test-deps.sh +++ b/test/fetch-test-deps.sh @@ -4,14 +4,16 @@ set -euo pipefail cd "$(dirname "$0")" usage() { - echo "Downloads source code of Game Boy programs used as RGBDS test cases." - echo "Options:" - echo " -h, --help show this help message" - echo " --only-free download only freely licensed codebases" - echo " --only-internal do not download any codebases" - echo " --get-deps install programs' own dependencies instead of themselves" - echo " --get-hash print programs' commit hashes instead of downloading them" - echo " --get-paths print programs' GitHub paths instead of downloading them" + cat <<"EOF" +Downloads source code of Game Boy programs used as RGBDS test cases. +Options: + -h, --help show this help message + --only-free download only freely licensed codebases + --only-internal do not download any codebases + --get-deps install programs' own dependencies instead of themselves + --get-hash print programs' commit hashes instead of downloading them + --get-paths print programs' GitHub paths instead of downloading them +EOF } # Parse options in pure Bash because macOS `getopt` is stuck diff --git a/test/run-tests.sh b/test/run-tests.sh index f49e74360..3720d037f 100755 --- a/test/run-tests.sh +++ b/test/run-tests.sh @@ -9,14 +9,17 @@ export SOURCE_DATE_EPOCH=609165296 cd "$(dirname "$0")" usage() { - echo "Runs regression tests on RGBDS." - echo "Options:" - echo " -h, --help show this help message" - echo " --only-internal only run tests that build local examples" - echo " --only-external only run tests that build external codebases" - echo " --only-free skip tests that build nonfree codebases" - echo " --installed-rgbds use the system installed RGBDS" - echo " (only compatible with external codebases)" + cat <<"EOF" +Runs regression tests on RGBDS. +Options: + -h, --help show this help message + --only-internal only run tests that build local examples + --only-external only run tests that build external codebases + --only-free skip tests that build nonfree codebases + --os skip tests known to fail on (e.g. `macos-14`) + --installed-rgbds use the system installed RGBDS + (only compatible with external codebases) +EOF } # Parse options in pure Bash because macOS `getopt` is stuck From 80c13c488531c99e8ccdbe8cd5eeaf85b505e929 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Mon, 9 Mar 2026 03:36:16 -0400 Subject: [PATCH 12/16] Print a more graceful error message for `run-tests.sh --unk` --- test/run-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/run-tests.sh b/test/run-tests.sh index 3720d037f..c648faf49 100755 --- a/test/run-tests.sh +++ b/test/run-tests.sh @@ -60,7 +60,7 @@ while [[ $# -gt 0 ]]; do break ;; *) - echo "$(basename "$0"): internal error" + echo "$(basename "$0"): unknown option '$1'" exit 1 ;; esac From 7f22892732cd13e2d6973b4f9bdac82b52d20ed4 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Mon, 9 Mar 2026 16:22:59 -0400 Subject: [PATCH 13/16] Move FreeBSD deps install to common CI script --- .github/scripts/install_deps.sh | 3 +++ .github/workflows/testing.yml | 7 +------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/scripts/install_deps.sh b/.github/scripts/install_deps.sh index 708ac6cd0..1fca339e9 100755 --- a/.github/scripts/install_deps.sh +++ b/.github/scripts/install_deps.sh @@ -13,6 +13,9 @@ case "${1%-*}" in export PATH="/opt/homebrew/opt/bison/bin:$PATH" printf 'PATH=%s\n' "$PATH" >>"$GITHUB_ENV" # Make it available to later CI steps too ;; + freebsd) + pkg install -y bash bison cmake git png + ;; *) echo "WARNING: Cannot install deps for OS '$1'" ;; diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index bdb165454..70ba52d7c 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -376,12 +376,7 @@ jobs: release: "14.3" usesh: true prepare: | - pkg install -y \ - bash \ - bison \ - cmake \ - git \ - png + .github/scripts/install_deps.sh freebsd run: | # FreeBSD `c++` compiler does not support `make develop` sanitizers ASan or UBSan cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=c++ -DUSE_EXTERNAL_TESTS=OFF -DTESTS_OS_NAME=bsd cmake --build build -j4 --verbose From c1f58041529bd304ad4f933ca24350ff6c9d1624 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Mon, 9 Mar 2026 23:37:20 -0400 Subject: [PATCH 14/16] Refactor the source file listing Make the common files into an object library, which lets them be compiled only once (saving 41 build steps) This also lends itself well to removing the per-program loop, which simplifies the code somewhat. --- src/CMakeLists.txt | 50 +++++++++++++++++++--------------------------- 1 file changed, 21 insertions(+), 29 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 26d9dd4dc..2eb2fbfec 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,7 +2,7 @@ configure_file(version.cpp _version.cpp ESCAPE_QUOTES) -set(common_src +add_library(common OBJECT "extern/getopt.cpp" "cli.cpp" "diagnostics.cpp" @@ -10,7 +10,7 @@ set(common_src "usage.cpp" "util.cpp" "_version.cpp" - ) +) find_package(BISON 3.0.0 REQUIRED) set(BISON_FLAGS "-Wall -Dlr.type=ielr") @@ -31,15 +31,8 @@ BISON_TARGET(ASM_PARSER "asm/parser.y" "${PROJECT_SOURCE_DIR}/src/asm/parser.cpp" COMPILE_FLAGS "${BISON_FLAGS}" DEFINES_FILE "${PROJECT_SOURCE_DIR}/src/asm/parser.hpp" - ) - -BISON_TARGET(LINKER_SCRIPT_PARSER "link/script.y" - "${PROJECT_SOURCE_DIR}/src/link/script.cpp" - COMPILE_FLAGS "${BISON_FLAGS}" - DEFINES_FILE "${PROJECT_SOURCE_DIR}/src/link/script.hpp" - ) - -set(rgbasm_src +) +add_executable(rgbasm $ "${BISON_ASM_PARSER_OUTPUT_SOURCE}" "asm/actions.cpp" "asm/charmap.cpp" @@ -60,9 +53,14 @@ set(rgbasm_src "linkdefs.cpp" "opmath.cpp" "verbosity.cpp" - ) +) -set(rgblink_src +BISON_TARGET(LINKER_SCRIPT_PARSER "link/script.y" + "${PROJECT_SOURCE_DIR}/src/link/script.cpp" + COMPILE_FLAGS "${BISON_FLAGS}" + DEFINES_FILE "${PROJECT_SOURCE_DIR}/src/link/script.hpp" +) +add_executable(rgblink $ "${BISON_LINKER_SCRIPT_PARSER_OUTPUT_SOURCE}" "link/assign.cpp" "link/fstack.cpp" @@ -81,16 +79,16 @@ set(rgblink_src "linkdefs.cpp" "opmath.cpp" "verbosity.cpp" - ) +) -set(rgbfix_src +add_executable(rgbfix $ "fix/fix.cpp" "fix/main.cpp" "fix/mbc.cpp" "fix/warning.cpp" - ) +) -set(rgbgfx_src +add_executable(rgbgfx $ "gfx/color_set.cpp" "gfx/main.cpp" "gfx/pal_packing.cpp" @@ -103,19 +101,13 @@ set(rgbgfx_src "gfx/rgba.cpp" "gfx/warning.cpp" "verbosity.cpp" - ) +) -foreach(PROG "asm" "fix" "gfx" "link") - add_executable(rgb${PROG} - ${rgb${PROG}_src} - ${common_src} - ) - install(TARGETS rgb${PROG} RUNTIME DESTINATION bin) - # Required to run tests - set_target_properties(rgb${PROG} PROPERTIES - # hack for MSVC: no-op generator expression to stop generation of "per-configuration subdirectory" - RUNTIME_OUTPUT_DIRECTORY $<1:${CMAKE_SOURCE_DIR}>) -endforeach() +install(TARGETS rgbasm rgblink rgbfix rgbgfx RUNTIME DESTINATION bin) +# Required to run tests +set_target_properties(rgbasm rgblink rgbfix rgbgfx PROPERTIES +# hack for MSVC: no-op generator expression to stop generation of "per-configuration subdirectory" + RUNTIME_OUTPUT_DIRECTORY $<1:${CMAKE_SOURCE_DIR}>) if(LIBPNG_FOUND) # pkg-config target_include_directories(rgbgfx PRIVATE ${LIBPNG_INCLUDE_DIRS}) From 2d7b5e148d4074df69c740cd097575e87e756f88 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Mon, 9 Mar 2026 23:44:19 -0400 Subject: [PATCH 15/16] Remove an outdated comment --- CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4fc14e986..e97e1c4c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -# SPDX-License-Identifier: MIT +## SPDX-License-Identifier: MIT # 3.17 required for LTO checks messages cmake_minimum_required(VERSION 3.17...4.2 FATAL_ERROR) @@ -105,8 +105,6 @@ add_subdirectory(src) set(CMAKE_CTEST_ARGUMENTS "--verbose") add_subdirectory(test) -# By default, build in Release mode; Debug mode must be explicitly requested -# (You may want to augment it with the options above) if(CMAKE_BUILD_TYPE STREQUAL "Release") message(CHECK_START "Checking if LTO is supported") include(CheckIPOSupported) From 0c713dbc3bf404f503426b03d58b3583b2dab19c Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Mon, 9 Mar 2026 23:45:06 -0400 Subject: [PATCH 16/16] Attempt to remove MSVC warning Hopefully Microsoft fixed their stuff by now, riiiight? --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e97e1c4c7..855833e81 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,7 @@ cmake_dependent_option(MORE_WARNINGS "Turn on more warnings" OFF !MSVC OFF) if(MSVC) add_compile_options( /MP # Build multiple files in parallel. - /wd5105 # MSVC's own standard library triggers warning C5105, "macro expansion producing 'defined' has undefined behavior". +# /wd5105 # MSVC's own standard library triggers warning C5105, "macro expansion producing 'defined' has undefined behavior". /wd5030 # Warning C5030 is about unknown attributes (`[[gnu::ATTR]]`), none of ours being load-bearing. /wd4996 # Warning C4996 is about using POSIX names, which we want to do for portability. /Zc:preprocessor # Opt into the C++20-conformant preprocessor.