Merge pull request #15805 from fp64/add-wformat

Add -Wformat (see issue #15792), no idea if ok.
This commit is contained in:
Henrik Rydgård 2022-08-07 15:57:47 +02:00 committed by GitHub
commit 929266cc9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)