]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Add -Wformat and -Wformat-security to default CFLAGS for all builds.
authorAndres Mejia <amejia004@gmail.com>
Fri, 24 Feb 2012 17:02:32 +0000 (12:02 -0500)
committerAndres Mejia <amejia004@gmail.com>
Fri, 24 Feb 2012 17:02:32 +0000 (12:02 -0500)
These are security related warnings.

CMakeLists.txt
Makefile.am

index 2adae3d32c8268e127565a974e4715c7bc47c4d1..bed93bf9dc331aa07095bb80f1bf8a869c8eec4c 100644 (file)
@@ -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
index 4856d2308f88bb2d4313eb61cd117fadca2f61c6..c6b9c9a4848b4ee08ecf790190136529a846f816 100644 (file)
@@ -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