build: specify -Wformat as a prerequisite of -Wformat-security
authorUri Simchoni <uri@samba.org>
Tue, 21 Nov 2017 18:55:16 +0000 (20:55 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 22 Nov 2017 09:20:21 +0000 (10:20 +0100)
Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
buildtools/wafsamba/samba_autoconf.py

index 682edf4215fc2939a119223d06aea4f0b3c32e01..e157b20de2ce78b3eff09450be7a23930c9f207b 100644 (file)
@@ -709,7 +709,8 @@ def SAMBA_CONFIG_H(conf, path=None):
 
         conf.ADD_CFLAGS('-Wformat=2 -Wno-format-y2k', testflags=True)
         conf.ADD_CFLAGS('-Wno-format-zero-length', testflags=True)
 
         conf.ADD_CFLAGS('-Wformat=2 -Wno-format-y2k', testflags=True)
         conf.ADD_CFLAGS('-Wno-format-zero-length', testflags=True)
-        conf.ADD_CFLAGS('-Werror=format-security -Wformat-security', testflags=True)
+        conf.ADD_CFLAGS('-Werror=format-security -Wformat-security',
+                        testflags=True, prereq_flags='-Wformat')
         # This check is because for ldb_search(), a NULL format string
         # is not an error, but some compilers complain about that.
         if CHECK_CFLAGS(conf, ["-Werror=format", "-Wformat=2"], '''
         # This check is because for ldb_search(), a NULL format string
         # is not an error, but some compilers complain about that.
         if CHECK_CFLAGS(conf, ["-Werror=format", "-Wformat=2"], '''