From 48aed2fabcd272f836115773a4bc537a44159133 Mon Sep 17 00:00:00 2001 From: fp64 <106717720+fp64@users.noreply.github.com> Date: Sun, 7 Aug 2022 09:12:58 -0400 Subject: [PATCH] Add -Wformat (see issue #15792), no idea if ok. Unfamiliar with CMake, just added a couple of lines at relevant-looking place. I did, at least, test that is compiles (and enables that flag) on my machine. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index b40aac8380..97b9bbde52 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -350,6 +350,9 @@ if(NOT MSVC) set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2 -D_NDEBUG") set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -O2 -g -D_NDEBUG") + # Enable checking printf-like format strings (also works for logging functions) + add_definitions(-Wformat) + # Disable some warnings add_definitions(-Wno-multichar)