build: disable format-zero-length warning
authorUri Simchoni <uri@samba.org>
Mon, 20 Nov 2017 08:17:16 +0000 (10:17 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 22 Nov 2017 09:20:21 +0000 (10:20 +0100)
format-zero-length warns against printf-style calls with
zero-length format string. vfs_full_audit module has such
calls, and up until now there was no warning against it because
the do_log in vfs_full_audit is not recognized as printf-style
function. In a following commit the do_log will be converted to
a printf-style function, hence the need to disable this warning.

(an alternative would be to disable only for vfs_full_audit, but that
would complicate things needlessly).

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
buildtools/wafsamba/samba_autoconf.py

index 795d13075cf41bb0b9ab60ac190669a09cf06cb5..4c0400a625da9618f2ac664d28c77f4304c91187 100644 (file)
@@ -708,6 +708,7 @@ def SAMBA_CONFIG_H(conf, path=None):
                         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)
         # This check is because for ldb_search(), a NULL format string
         # is not an error, but some compilers complain about that.