[SCM] Samba Shared Repository - branch master updated
Andreas Schneider
asn at samba.org
Fri May 8 11:17:05 UTC 2020
The branch, master has been updated
via e907f002a7f Fix clang 9 for-loop-analysis warnings
via 8c17b6f82fd Fix clang 9 format-nonliteral warnings
via 13a2f70a4dd Fix clang 9 missing-field-initializer warnings
via c2b0071460c Fix clang 9 unused-function warnings
via d55812e4eee Fix clang 9 enum-conversion warnings
via 5e44b7cdfc5 Fix clang 9 constant-conversion warnings
via fa8332780d2 Fix clang 9 logical-not-parentheses warnings
via 9df4d6ab494 Fix clang 9 parentheses-equality warnings
via dfdf8217aaa build: Allow developer builds with clang 9
from c6e71fbd68c s3: VFS: Complete the replacement of SMB_VFS_GET_NT_ACL() -> SMB_VFS_GET_NT_ACL_AT().
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit e907f002a7f3184d09135066c3ffb12d95007769
Author: Gary Lockyer <gary at catalyst.net.nz>
Date: Tue May 5 11:42:28 2020 +1200
Fix clang 9 for-loop-analysis warnings
Review-note: The for loop increment operation was changed and the
trailing i++ was removed from the loop body.
The resulting for statement is equivalent to the original
Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn at samba.org>
Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date(master): Fri May 8 11:16:18 UTC 2020 on sn-devel-184
commit 8c17b6f82fd8d40d4ba0819ebc6e6c55fe2fb012
Author: Gary Lockyer <gary at catalyst.net.nz>
Date: Tue May 5 13:48:10 2020 +1200
Fix clang 9 format-nonliteral warnings
Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn at samba.org>
commit 13a2f70a4dd6dd68e0dbd0379d35409c5f100f06
Author: Gary Lockyer <gary at catalyst.net.nz>
Date: Tue May 5 13:47:39 2020 +1200
Fix clang 9 missing-field-initializer warnings
Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn at samba.org>
commit c2b0071460c09eb24d12880e54e2f80c77834ebb
Author: Gary Lockyer <gary at catalyst.net.nz>
Date: Fri May 1 15:03:10 2020 +1200
Fix clang 9 unused-function warnings
Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn at samba.org>
commit d55812e4eee41fa913a9d102a54ee4d7f85fc2bc
Author: Gary Lockyer <gary at catalyst.net.nz>
Date: Fri May 1 11:58:52 2020 +1200
Fix clang 9 enum-conversion warnings
Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn at samba.org>
commit 5e44b7cdfc5eb4b9bc7ab9d43291403fcc05de87
Author: Gary Lockyer <gary at catalyst.net.nz>
Date: Fri May 1 11:41:08 2020 +1200
Fix clang 9 constant-conversion warnings
Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn at samba.org>
commit fa8332780d2b0d31e92846fa7b1a45c130fa35c4
Author: Gary Lockyer <gary at catalyst.net.nz>
Date: Fri May 1 11:17:04 2020 +1200
Fix clang 9 logical-not-parentheses warnings
Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn at samba.org>
commit 9df4d6ab4944c6c606502981517f4e345c5c797e
Author: Gary Lockyer <gary at catalyst.net.nz>
Date: Fri May 1 10:42:03 2020 +1200
Fix clang 9 parentheses-equality warnings
Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn at samba.org>
commit dfdf8217aaabf2b7d47fb862bc785f7ada12d883
Author: Gary Lockyer <gary at catalyst.net.nz>
Date: Fri May 1 09:55:03 2020 +1200
build: Allow developer builds with clang 9
Disable clang warnings to allow samba to be compiled with clang 9.
Subsequent commits will fix offending code and re-enable the warnings.
However fixing cast-align warnings has been left for later.
Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn at samba.org>
-----------------------------------------------------------------------
Summary of changes:
auth/credentials/pycredentials.c | 2 +-
buildtools/wafsamba/samba_autoconf.py | 1 +
examples/libsmbclient/testbrowse.c | 4 +---
lib/crypto/py_crypto.c | 2 +-
lib/ldb-samba/pyldb.c | 2 +-
lib/ldb-samba/samba_extensions.c | 4 ++--
lib/ldb/ldb_mdb/ldb_mdb.c | 2 +-
lib/ldb/pyldb.c | 16 ++++++++--------
lib/ldb/tests/ldb_mod_op_test.c | 6 ++++--
lib/ldb/tools/cmdline.c | 2 +-
lib/talloc/pytalloc.c | 2 +-
lib/talloc/test_pytalloc.c | 2 +-
lib/tdb/pytdb.c | 2 +-
lib/tevent/pytevent.c | 16 ++++++++--------
libcli/nbt/pynbt.c | 2 +-
libcli/security/pysecurity.c | 2 +-
libgpo/pygpo.c | 8 ++++----
librpc/tools/ndrdump.c | 2 +-
pidl/lib/Parse/Pidl/Samba4/Python.pm | 15 +++++++++++++--
python/pyglue.c | 2 +-
source3/libsmb/pylibsmb.c | 2 +-
source3/modules/vfs_virusfilter_utils.c | 6 +++---
source3/param/pyparam.c | 2 +-
source3/passdb/py_passdb.c | 4 ++--
source3/rpc_client/py_mdscli.c | 6 +++---
source3/rpcclient/cmd_spotlight.c | 2 +-
source3/smbd/posix_acls.c | 2 +-
source3/smbd/pysmbd.c | 2 +-
source3/torture/cmd_vfs.c | 2 +-
source3/utils/smbcontrol.c | 2 +-
source4/auth/gensec/pygensec.c | 2 +-
source4/auth/pyauth.c | 2 +-
source4/client/cifsdd.c | 2 +-
source4/dns_server/dlz_bind9.c | 2 +-
source4/dns_server/pydns.c | 2 +-
source4/dsdb/common/util.c | 2 +-
source4/dsdb/pydsdb.c | 2 +-
source4/dsdb/samdb/ldb_modules/count_attrs.c | 2 +-
source4/lib/policy/pypolicy.c | 2 +-
source4/lib/registry/pyregistry.c | 6 +++---
source4/lib/registry/tools/regdiff.c | 2 +-
source4/lib/registry/tools/regpatch.c | 2 +-
source4/lib/registry/tools/regshell.c | 4 ++--
source4/lib/registry/tools/regtree.c | 2 +-
source4/libcli/resolve/lmhosts.c | 3 +--
source4/librpc/ndr/py_security.c | 8 ++++----
source4/librpc/ndr/py_xattr.c | 2 +-
source4/ntvfs/posix/python/pyposix_eadb.c | 2 +-
source4/ntvfs/posix/python/pyxattr_native.c | 2 +-
source4/ntvfs/posix/python/pyxattr_tdb.c | 2 +-
source4/param/pyparam.c | 6 +++---
source4/torture/gentest.c | 2 +-
source4/torture/gpo/apply.c | 2 +-
source4/torture/ldb/ldb.c | 15 +++++++++------
source4/torture/locktest.c | 2 +-
source4/torture/masktest.c | 2 +-
source4/torture/ndr/dnsp.c | 2 +-
source4/torture/smb2/timestamps.c | 2 +-
source4/torture/smbtorture.c | 2 +-
source4/torture/vfs/fruit.c | 2 +-
source4/utils/oLschema2ldif/main.c | 2 +-
61 files changed, 115 insertions(+), 101 deletions(-)
Changeset truncated at 500 lines:
diff --git a/auth/credentials/pycredentials.c b/auth/credentials/pycredentials.c
index fad07b84ba7..a5d0f9e051c 100644
--- a/auth/credentials/pycredentials.c
+++ b/auth/credentials/pycredentials.c
@@ -1252,7 +1252,7 @@ static PyObject *py_ccache_name(PyObject *self, PyObject *unused)
static PyMethodDef py_ccache_container_methods[] = {
{ "get_name", py_ccache_name, METH_NOARGS,
"S.get_name() -> name\nObtain KRB5 credentials cache name." },
- { NULL }
+ {0}
};
PyTypeObject PyCredentialCacheContainer = {
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index 4615e201422..276b88780b8 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -790,6 +790,7 @@ int main(void) {
if not Options.options.disable_warnings_as_errors:
conf.ADD_NAMED_CFLAGS('PICKY_CFLAGS', '-Werror -Wno-error=deprecated-declarations', testflags=True)
conf.ADD_NAMED_CFLAGS('PICKY_CFLAGS', '-Wno-error=tautological-compare', testflags=True)
+ conf.ADD_NAMED_CFLAGS('PICKY_CFLAGS', '-Wno-error=cast-align', testflags=True)
if Options.options.fatal_errors:
conf.ADD_CFLAGS('-Wfatal-errors', testflags=True)
diff --git a/examples/libsmbclient/testbrowse.c b/examples/libsmbclient/testbrowse.c
index 0629653ef8b..1609e2f4f91 100644
--- a/examples/libsmbclient/testbrowse.c
+++ b/examples/libsmbclient/testbrowse.c
@@ -65,9 +65,7 @@ int main(int argc, const char *argv[])
"contextauth", 'C', POPT_ARG_NONE, &context_auth,
0, "Use new authentication function with context", "integer"
},
- {
- NULL
- }
+ {0}
};
setbuf(stdout, NULL);
diff --git a/lib/crypto/py_crypto.c b/lib/crypto/py_crypto.c
index c85cd2c13d2..32b946eee8f 100644
--- a/lib/crypto/py_crypto.c
+++ b/lib/crypto/py_crypto.c
@@ -91,7 +91,7 @@ static const char py_crypto_arcfour_crypt_blob_doc[] = "arcfour_crypt_blob(data,
static PyMethodDef py_crypto_methods[] = {
{ "arcfour_crypt_blob", (PyCFunction)py_crypto_arcfour_crypt_blob, METH_VARARGS, py_crypto_arcfour_crypt_blob_doc },
- { NULL },
+ {0},
};
static struct PyModuleDef moduledef = {
diff --git a/lib/ldb-samba/pyldb.c b/lib/ldb-samba/pyldb.c
index 48adc74b16a..bea489489ef 100644
--- a/lib/ldb-samba/pyldb.c
+++ b/lib/ldb-samba/pyldb.c
@@ -266,7 +266,7 @@ static PyMethodDef py_samba_ldb_methods[] = {
{ "samba_schema_attribute_add",
(PyCFunction)py_ldb_samba_schema_attribute_add,
METH_VARARGS, NULL },
- { NULL },
+ {0},
};
static struct PyModuleDef moduledef = {
diff --git a/lib/ldb-samba/samba_extensions.c b/lib/ldb-samba/samba_extensions.c
index 45b01e1b447..65a4079ec97 100644
--- a/lib/ldb-samba/samba_extensions.c
+++ b/lib/ldb-samba/samba_extensions.c
@@ -41,7 +41,7 @@
static unsigned calculate_popt_array_length(struct poptOption *opts)
{
unsigned i;
- struct poptOption zero_opt = { NULL };
+ struct poptOption zero_opt = { 0 };
for (i=0; memcmp(&zero_opt, &opts[i], sizeof(zero_opt)) != 0; i++) ;
return i;
}
@@ -51,7 +51,7 @@ static struct poptOption cmdline_extensions[] = {
POPT_COMMON_CREDENTIALS
POPT_COMMON_CONNECTION
POPT_COMMON_VERSION
- { NULL }
+ {0}
};
/*
diff --git a/lib/ldb/ldb_mdb/ldb_mdb.c b/lib/ldb/ldb_mdb/ldb_mdb.c
index f0a418d07ee..c163321d5a7 100644
--- a/lib/ldb/ldb_mdb/ldb_mdb.c
+++ b/lib/ldb/ldb_mdb/ldb_mdb.c
@@ -183,7 +183,7 @@ static int lmdb_store(struct ldb_kv_private *ldb_kv,
if (flags == TDB_INSERT) {
mdb_flags = MDB_NOOVERWRITE;
- } else if ((flags == TDB_MODIFY)) {
+ } else if (flags == TDB_MODIFY) {
/*
* Modifying a record, ensure that it exists.
* This mimics the TDB semantics
diff --git a/lib/ldb/pyldb.c b/lib/ldb/pyldb.c
index eb879b98984..813cdb0870e 100644
--- a/lib/ldb/pyldb.c
+++ b/lib/ldb/pyldb.c
@@ -730,7 +730,7 @@ static PyObject *py_ldb_dn_set_component(PyLdbDnObject *self, PyObject *args)
{
unsigned int num = 0;
char *name = NULL, *value = NULL;
- struct ldb_val val = { NULL, };
+ struct ldb_val val = { 0 };
int err;
Py_ssize_t size = 0;
@@ -847,7 +847,7 @@ static PyMethodDef py_ldb_dn_methods[] = {
{ "get_rdn_value", (PyCFunction)py_ldb_dn_get_rdn_value, METH_NOARGS,
"S.get_rdn_value() -> string\n"
"get the RDN attribute value as a binary string" },
- { NULL }
+ {0}
};
static Py_ssize_t py_ldb_dn_len(PyLdbDnObject *self)
@@ -2398,7 +2398,7 @@ static PyMethodDef py_ldb_methods[] = {
{ "_register_test_extensions", (PyCFunction)py_ldb_register_test_extensions, METH_NOARGS,
"S._register_test_extensions() -> None\n"
"Register internal extensions used in testing" },
- { NULL },
+ {0},
};
static PyObject *PyLdbModule_FromModule(struct ldb_module *mod)
@@ -2725,7 +2725,7 @@ static PyMethodDef py_ldb_search_iterator_methods[] = {
"S.result() -> ldb.Result (without msgs and referrals)\n" },
{ "abandon", (PyCFunction)py_ldb_search_iterator_abandon, METH_NOARGS,
"S.abandon()\n" },
- { NULL }
+ {0}
};
static PyObject *py_ldb_search_iterator_repr(PyLdbSearchIteratorObject *self)
@@ -2920,7 +2920,7 @@ static PyMethodDef py_ldb_module_methods[] = {
{ "start_transaction", (PyCFunction)py_ldb_module_start_transaction, METH_NOARGS, NULL },
{ "end_transaction", (PyCFunction)py_ldb_module_end_transaction, METH_NOARGS, NULL },
{ "del_transaction", (PyCFunction)py_ldb_module_del_transaction, METH_NOARGS, NULL },
- { NULL },
+ {0},
};
static void py_ldb_module_dealloc(PyLdbModuleObject *self)
@@ -3098,7 +3098,7 @@ static PyMethodDef py_ldb_msg_element_methods[] = {
{ "get", (PyCFunction)py_ldb_msg_element_get, METH_VARARGS, NULL },
{ "set_flags", (PyCFunction)py_ldb_msg_element_set_flags, METH_VARARGS, NULL },
{ "flags", (PyCFunction)py_ldb_msg_element_flags, METH_NOARGS, NULL },
- { NULL },
+ {0},
};
static Py_ssize_t py_ldb_msg_element_len(PyLdbMessageElementObject *self)
@@ -3603,7 +3603,7 @@ static PyMethodDef py_ldb_msg_methods[] = {
{ "add", (PyCFunction)py_ldb_msg_add, METH_VARARGS,
"S.add(element)\n\n"
"Add an element to this message." },
- { NULL },
+ {0},
};
static PyObject *py_ldb_msg_iter(PyLdbMessageObject *self)
@@ -4280,7 +4280,7 @@ static PyMethodDef py_ldb_global_methods[] = {
{ "binary_decode", py_binary_decode, METH_VARARGS,
"S.binary_decode(string) -> string\n\n"
"Perform a RFC2254 binary decode on a string" },
- { NULL }
+ {0}
};
#define MODULE_DOC "An interface to LDB, a LDAP-like API that can either to talk an embedded database (TDB-based) or a standards-compliant LDAP server."
diff --git a/lib/ldb/tests/ldb_mod_op_test.c b/lib/ldb/tests/ldb_mod_op_test.c
index 0aa9ac2ce27..cf40fe42b73 100644
--- a/lib/ldb/tests/ldb_mod_op_test.c
+++ b/lib/ldb/tests/ldb_mod_op_test.c
@@ -3745,8 +3745,10 @@ static void test_ldb_add_to_index_unique_values_required(void **state)
talloc_free(tmp_ctx);
}
-static void ldb_debug_string(void *context, enum ldb_debug_level level,
- const char *fmt, va_list ap)
+static void PRINTF_ATTRIBUTE(3, 0) ldb_debug_string(
+ void *context,
+ enum ldb_debug_level level,
+ const char *fmt, va_list ap)
{
struct ldbtest_ctx *test_ctx =
talloc_get_type_abort(context, struct ldbtest_ctx);
diff --git a/lib/ldb/tools/cmdline.c b/lib/ldb/tools/cmdline.c
index d53161574fd..e5bb499c97e 100644
--- a/lib/ldb/tools/cmdline.c
+++ b/lib/ldb/tools/cmdline.c
@@ -59,7 +59,7 @@ static struct poptOption builtin_popt_options[] = {
{ "relax", 0, POPT_ARG_NONE, NULL, CMDLINE_RELAX, "pass relax control", NULL },
{ "cross-ncs", 0, POPT_ARG_NONE, NULL, 'N', "search across NC boundaries", NULL },
{ "extended-dn", 0, POPT_ARG_NONE, NULL, 'E', "show extended DNs", NULL },
- { NULL }
+ {0}
};
void ldb_cmdline_help(struct ldb_context *ldb, const char *cmdname, FILE *f)
diff --git a/lib/talloc/pytalloc.c b/lib/talloc/pytalloc.c
index 12c7325fcac..cc5a6a812ea 100644
--- a/lib/talloc/pytalloc.c
+++ b/lib/talloc/pytalloc.c
@@ -70,7 +70,7 @@ static PyMethodDef talloc_methods[] = {
"enable tracking of the NULL object"},
{ "total_blocks", (PyCFunction)pytalloc_total_blocks, METH_VARARGS,
"return talloc block count"},
- { NULL }
+ {0}
};
/**
diff --git a/lib/talloc/test_pytalloc.c b/lib/talloc/test_pytalloc.c
index 6797b98c6b9..3b0484b2274 100644
--- a/lib/talloc/test_pytalloc.c
+++ b/lib/talloc/test_pytalloc.c
@@ -95,7 +95,7 @@ static PyMethodDef test_talloc_methods[] = {
"call pytalloc_reference_ex"},
{ "base_reference", (PyCFunction)testpytalloc_base_reference, METH_VARARGS,
"call pytalloc_reference_ex"},
- { NULL }
+ {0}
};
static PyTypeObject DObject_Type;
diff --git a/lib/tdb/pytdb.c b/lib/tdb/pytdb.c
index 69da98c34d4..2ea2042c1e5 100644
--- a/lib/tdb/pytdb.c
+++ b/lib/tdb/pytdb.c
@@ -589,7 +589,7 @@ static PyMethodDef tdb_object_methods[] = {
"S.enable_seqnum() -> None" },
{ "increment_seqnum_nonblock", (PyCFunction)obj_increment_seqnum_nonblock, METH_NOARGS,
"S.increment_seqnum_nonblock() -> None" },
- { NULL }
+ {0}
};
static PyObject *obj_get_hash_size(PyTdbObject *self, void *closure)
diff --git a/lib/tevent/pytevent.c b/lib/tevent/pytevent.c
index dde6bd010c7..93375f71868 100644
--- a/lib/tevent/pytevent.c
+++ b/lib/tevent/pytevent.c
@@ -269,7 +269,7 @@ static PyMethodDef py_tevent_queue_methods[] = {
"S.start()" },
{ "add", (PyCFunction)py_tevent_queue_add, METH_VARARGS,
"S.add(ctx, req, trigger, baton)" },
- { NULL },
+ {0},
};
static PyObject *py_tevent_context_wakeup_send(PyObject *self, PyObject *args)
@@ -394,7 +394,7 @@ struct PyGetSetDef py_tevent_timer_getset[] = {
.get = (getter)py_tevent_timer_get_active,
.doc = discard_const_p(char, "true if the timer is scheduled to run"),
},
- {NULL},
+ {0},
};
static PyTypeObject TeventTimer_Type = {
@@ -576,7 +576,7 @@ static PyMethodDef py_tevent_context_methods[] = {
METH_VARARGS, "S.add_timer(offset_seconds, handler) -> timer" },
{ "add_fd", (PyCFunction)py_tevent_context_add_fd,
METH_VARARGS, "S.add_fd(fd, flags, handler) -> fd" },
- { NULL },
+ {0},
};
static PyObject *py_tevent_req_wakeup_recv(PyObject *self,
@@ -620,7 +620,7 @@ static PyGetSetDef py_tevent_req_getsetters[] = {
.get = (getter)py_tevent_req_is_in_progress,
.doc = discard_const_p(char, "Whether the request is in progress"),
},
- { NULL }
+ {0}
};
static PyObject *py_tevent_req_post(PyObject *self, PyObject *args)
@@ -688,7 +688,7 @@ static PyMethodDef py_tevent_req_methods[] = {
METH_VARARGS, "set_endtime(ctx, endtime)" },
{ "cancel", (PyCFunction)py_tevent_req_cancel,
METH_NOARGS, "cancel()" },
- { NULL }
+ {0}
};
static void py_tevent_req_dealloc(TeventReq_Object *self)
@@ -718,7 +718,7 @@ static PyGetSetDef py_tevent_queue_getsetters[] = {
.get = (getter)py_tevent_queue_get_length,
.doc = discard_const_p(char, "The number of elements in the queue."),
},
- { NULL },
+ {0},
};
static void py_tevent_queue_dealloc(TeventQueue_Object *self)
@@ -750,7 +750,7 @@ static PyGetSetDef py_tevent_context_getsetters[] = {
py_tevent_context_signal_support),
.doc = discard_const_p(char, "if this platform and tevent context support signal handling"),
},
- { NULL }
+ {0}
};
static void py_tevent_context_dealloc(TeventContext_Object *self)
@@ -861,7 +861,7 @@ static PyMethodDef tevent_methods[] = {
METH_VARARGS, "set_default_backend(backend)" },
{ "backend_list", (PyCFunction)py_backend_list,
METH_NOARGS, "backend_list() -> list" },
- { NULL },
+ {0},
};
#define MODULE_DOC PyDoc_STR("Python wrapping of talloc-maintained objects.")
diff --git a/libcli/nbt/pynbt.c b/libcli/nbt/pynbt.c
index d8a781b5290..0908a6bce3c 100644
--- a/libcli/nbt/pynbt.c
+++ b/libcli/nbt/pynbt.c
@@ -409,7 +409,7 @@ static PyMethodDef py_nbt_methods[] = {
"S.name_status(name, dest, timeout=0, retries=0) -> (reply_from, name, status)\n"
"Find the status of a name" },
- { NULL }
+ {0}
};
PyTypeObject nbt_node_Type = {
diff --git a/libcli/security/pysecurity.c b/libcli/security/pysecurity.c
index 9f4aa147c6a..80730485242 100644
--- a/libcli/security/pysecurity.c
+++ b/libcli/security/pysecurity.c
@@ -73,7 +73,7 @@ static PyMethodDef py_security_methods[] = {
py_se_access_check),
METH_VARARGS|METH_KEYWORDS,
"access_check(security_descriptor, token, access_desired) -> access_granted. Raises NT_STATUS on error, including on access check failure, returns access granted bitmask"},
- { NULL },
+ {0},
};
static struct PyModuleDef moduledef = {
diff --git a/libgpo/pygpo.c b/libgpo/pygpo.c
index 97bbb3ec528..29c8b11886e 100644
--- a/libgpo/pygpo.c
+++ b/libgpo/pygpo.c
@@ -67,7 +67,7 @@ static PyGetSetDef GPO_setters[] = {
NULL, NULL, NULL},
{discard_const_p(char, "machine_extensions"),
(getter)GPO_get_machine_extensions, NULL, NULL, NULL},
- {NULL}
+ {0}
};
static PyObject *py_gpo_get_unix_path(PyObject *self, PyObject *args,
@@ -120,7 +120,7 @@ static PyMethodDef GPO_methods[] = {
py_gpo_get_unix_path),
METH_VARARGS | METH_KEYWORDS,
NULL },
- {NULL}
+ {0}
};
static PyTypeObject GPOType = {
@@ -493,7 +493,7 @@ static PyMethodDef ADS_methods[] = {
METH_VARARGS | METH_KEYWORDS,
NULL },
#endif
- { NULL }
+ {0}
};
static PyTypeObject ads_ADSType = {
@@ -510,7 +510,7 @@ static PyMethodDef py_gpo_methods[] = {
{"gpo_get_sysvol_gpt_version",
(PyCFunction)py_gpo_get_sysvol_gpt_version,
METH_VARARGS, NULL},
- {NULL}
+ {0}
};
static struct PyModuleDef moduledef = {
diff --git a/librpc/tools/ndrdump.c b/librpc/tools/ndrdump.c
index 914c67e98e2..2872a85b621 100644
--- a/librpc/tools/ndrdump.c
+++ b/librpc/tools/ndrdump.c
@@ -316,7 +316,7 @@ static void ndr_print_dummy(struct ndr_print *ndr, const char *format, ...)
"Try to print structures that fail to parse (used to develop parsers, segfaults are likely).", NULL },
POPT_COMMON_SAMBA
POPT_COMMON_VERSION
- { NULL }
+ {0}
};
uint32_t highest_ofs;
struct dcerpc_sec_verification_trailer *sec_vt = NULL;
diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm
index 12ddd046062..344f48987d1 100644
--- a/pidl/lib/Parse/Pidl/Samba4/Python.pm
+++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm
@@ -1419,7 +1419,7 @@ sub Interface($$$)
my ($infn, $outfn, $callfn, $prettyname, $docstring, $opnum) = @$d;
$self->pidl("{ \"$prettyname\", $docstring, (py_dcerpc_call_fn)$callfn, (py_data_pack_fn)$infn, (py_data_unpack_fn)$outfn, $opnum, &ndr_table_$interface->{NAME} },");
}
- $self->pidl("{ NULL }");
+ $self->pidl("{0}");
$self->deindent;
$self->pidl("};");
$self->pidl("");
@@ -2294,6 +2294,17 @@ sub Parse($$$$$)
#include \"$hdr\"
$ndr_hdr_include
+/*
+ * Suppress compiler warnings if the generated code does not call these
+ * functions
+ */
+#ifndef _MAYBE_UNUSED_
+#ifdef HAVE___ATTRIBUTE__
+#define _MAYBE_UNUSED_ __attribute__ ((unused))
+#else
+#define _MAYBE_UNUSED_
+#endif
+#endif
/*
* These functions are here to ensure they can be optimized out by
* the compiler based on the constant input values
@@ -2315,7 +2326,7 @@ static inline unsigned long long ndr_sizeof2uintmax(size_t var_size)
return 0;
}
-static inline long long ndr_sizeof2intmax(size_t var_size)
+static inline _MAYBE_UNUSED_ long long ndr_sizeof2intmax(size_t var_size)
{
switch (var_size) {
case 8:
diff --git a/python/pyglue.c b/python/pyglue.c
index ef1419fbd88..aff9365d11b 100644
--- a/python/pyglue.c
+++ b/python/pyglue.c
@@ -389,7 +389,7 @@ static PyMethodDef py_misc_methods[] = {
METH_VARARGS,
"generate_random_bytes(len) -> bytes\n"
"Generate random bytes with specified length." },
- { NULL }
+ {0}
};
static struct PyModuleDef moduledef = {
diff --git a/source3/libsmb/pylibsmb.c b/source3/libsmb/pylibsmb.c
index e61ca5c1993..bfa6f1bec24 100644
--- a/source3/libsmb/pylibsmb.c
+++ b/source3/libsmb/pylibsmb.c
@@ -1654,7 +1654,7 @@ static PyTypeObject py_cli_state_type = {
};
static PyMethodDef py_libsmb_methods[] = {
- { NULL },
+ {0},
};
void initlibsmb_samba_internal(void);
diff --git a/source3/modules/vfs_virusfilter_utils.c b/source3/modules/vfs_virusfilter_utils.c
index 0ee17ef7479..c7f8089ffc7 100644
--- a/source3/modules/vfs_virusfilter_utils.c
+++ b/source3/modules/vfs_virusfilter_utils.c
@@ -397,7 +397,7 @@ bool virusfilter_io_writel(
return virusfilter_io_write(io_h, io_h->w_eol, io_h->w_eol_size);
}
-bool virusfilter_io_writefl(
+bool PRINTF_ATTRIBUTE(2, 3) virusfilter_io_writefl(
struct virusfilter_io_handle *io_h,
const char *data_fmt, ...)
{
@@ -420,7 +420,7 @@ bool virusfilter_io_writefl(
return virusfilter_io_write(io_h, data, data_size);
}
-bool virusfilter_io_vwritefl(
+bool PRINTF_ATTRIBUTE(2, 0) virusfilter_io_vwritefl(
struct virusfilter_io_handle *io_h,
const char *data_fmt, va_list ap)
{
@@ -670,7 +670,7 @@ bool virusfilter_io_readl(TALLOC_CTX *ctx,
return ok;
}
-bool virusfilter_io_writefl_readl(
+bool PRINTF_ATTRIBUTE(3, 4) virusfilter_io_writefl_readl(
struct virusfilter_io_handle *io_h,
char **read_line,
const char *fmt, ...)
diff --git a/source3/param/pyparam.c b/source3/param/pyparam.c
index 6f709afe96e..749cfe308f4 100644
--
Samba Shared Repository
More information about the samba-cvs
mailing list