From: Andrew Bartlett Date: Mon, 17 Sep 2018 22:34:33 +0000 (-0700) Subject: Fix pdb_samba_dsdb build on Ubuntu 16.04 with -O3 -Werror=strict-overflow X-Git-Tag: tdb-1.3.17~1523 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf7e7710e15016ce5528d7eed8b58d4d3f4934d3;p=thirdparty%2Fsamba.git Fix pdb_samba_dsdb build on Ubuntu 16.04 with -O3 -Werror=strict-overflow ../source3/passdb/pdb_samba_dsdb.c: In function ‘pdb_samba_dsdb_set_trusteddom_pw’: ../source3/passdb/pdb_samba_dsdb.c:2778:6: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow] if (i == 0) { ^ cc1: all warnings being treated as errors gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.10) Signed-off-by: Andrew Bartlett Reviewed-by: Jeremy Allison Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Thu Sep 20 01:29:48 CEST 2018 on sn-devel-144 --- diff --git a/source3/passdb/pdb_samba_dsdb.c b/source3/passdb/pdb_samba_dsdb.c index f405c51aaeb..2f655c7c79a 100644 --- a/source3/passdb/pdb_samba_dsdb.c +++ b/source3/passdb/pdb_samba_dsdb.c @@ -2603,7 +2603,7 @@ static bool pdb_samba_dsdb_set_trusteddom_pw(struct pdb_methods *m, struct ldb_message *msg = NULL; int trust_direction_flags; int trust_type; - int i; + uint32_t i; /* The same type as old_blob.current.count */ const struct ldb_val *old_val = NULL; struct trustAuthInOutBlob old_blob = {}; uint32_t old_version = 0;