wafsamba: add -Werror=cast-function-type -Wcast-function-type
authorStefan Metzmacher <metze@samba.org>
Wed, 4 Dec 2019 10:59:19 +0000 (11:59 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 28 Jan 2020 12:26:21 +0000 (13:26 +0100)
This produces the following warnings/errors and found the bug
fixed in the previous commit:

 librpc/gen_ndr/ndr_misc.c:851:15: error: cast between incompatible function types
   from ‘enum ndr_err_code (*)(struct ndr_push *, int,  enum netr_SchannelType)’ to
   ‘enum ndr_err_code (*)(struct ndr_push *, int,  const void *)’ [-Werror=cast-function-type]
   .ndr_push = (ndr_push_flags_fn_t) ndr_push_netr_SchannelType,

Signed-off-by: Stefan Metzmacher <metze@samba.org>
buildtools/wafsamba/samba_autoconf.py

index 4615e201422b53ea4c5b9fea2b7220e0d11218cd..94373ac59bab5c0fb73de7de563fdb9d541bf686 100644 (file)
@@ -751,6 +751,8 @@ def SAMBA_CONFIG_H(conf, path=None):
         # we add these here to ensure that -Wstrict-prototypes is not set during configure
         conf.ADD_CFLAGS('-Werror=strict-prototypes -Wstrict-prototypes',
                         testflags=True)
+        conf.ADD_CFLAGS('-Werror=cast-function-type -Wcast-function-type',
+                        testflags=True)
         conf.ADD_CFLAGS('-Werror=write-strings -Wwrite-strings',
                         testflags=True)
         conf.ADD_CFLAGS('-Werror-implicit-function-declaration',