From: Andres Mejia Date: Fri, 24 Feb 2012 17:02:32 +0000 (-0500) Subject: Add -Wformat and -Wformat-security to default CFLAGS for all builds. X-Git-Tag: v3.0.4~2^2~59 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5ea29ca07b2640da392ab805205173ea65914617;p=thirdparty%2Flibarchive.git Add -Wformat and -Wformat-security to default CFLAGS for all builds. These are security related warnings. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 2adae3d32..bed93bf9d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,9 +57,9 @@ SET(SOVERSION "${INTERFACE_VERSION}") # aggressive about diagnosing build problems; this can get # relaxed somewhat in final shipping versions. IF ("CMAKE_C_COMPILER_ID" MATCHES "^GNU$") - SET(CMAKE_REQUIRED_FLAGS "-Wall") + SET(CMAKE_REQUIRED_FLAGS "-Wall -Wformat -Wformat-security") # Set compile flags for all build types. - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wformat -Wformat-security") # Set compile flags for debug build. # This is added into CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug" SET(CMAKE_C_FLAGS_DEBUG diff --git a/Makefile.am b/Makefile.am index 4856d2308..c6b9c9a48 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,7 +21,7 @@ TESTS= libarchive_test $(bsdtar_test_programs) $(bsdcpio_test_programs) TESTS_ENVIRONMENT= $(libarchive_TESTS_ENVIRONMENT) $(bsdtar_TESTS_ENVIRONMENT) $(bsdcpio_TESTS_ENVIRONMENT) # Always build and test both bsdtar and bsdcpio as part of 'distcheck' DISTCHECK_CONFIGURE_FLAGS = --enable-bsdtar --enable-bsdcpio -COMMON_CFLAGS=-Wall +COMMON_CFLAGS=-Wall -Wformat -Wformat-security # The next line is commented out by default in shipping libarchive releases. # It is uncommented by default in trunk. DEV_CFLAGS=-Werror -Wextra -Wunused -Wshadow -Wmissing-prototypes -Wcast-qual