[PATCHES] fix some build warnings

Günther Deschner gd at samba.org
Fri Feb 5 14:14:26 UTC 2016


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

And here they are for real :)

On 05/02/16 15:07, Günther Deschner wrote:
> Hi,
> 
> after building samba with gcc6, here are some first build warning
> fixes.
> 
> Please review & push,
> 
> Thanks, Guenther
> 

- -- 
Günther Deschner                    GPG-ID: 8EE11688
Red Hat                         gdeschner at redhat.com
Samba Team                              gd at samba.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iEYEARECAAYFAla0rkIACgkQSOk3aI7hFoiuzACcCPmk6E63pJqv7hSIWPumA+j1
ITcAnRRq0v3WpreOXHNRlILk3y6imgmL
=/Yla
-----END PGP SIGNATURE-----
-------------- next part --------------
From c67e19fcbd49ae241ba0ffd358625a55c1130359 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Fri, 5 Feb 2016 11:14:58 +0100
Subject: [PATCH 1/7] s4-torture: fix gcc6 build warning.

source4/torture/raw/eas.c:322:17: warning: comparison of constant '0' with
boolean expression is always false [-Wbool-compare]

Guenther

Signed-off-by: Guenther Deschner <gd at samba.org>
---
 source4/torture/raw/eas.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/source4/torture/raw/eas.c b/source4/torture/raw/eas.c
index 15bfb2f..eace20a 100644
--- a/source4/torture/raw/eas.c
+++ b/source4/torture/raw/eas.c
@@ -304,7 +304,7 @@ static bool test_max_eas(struct smbcli_state *cli, struct torture_context *tctx)
 	maxeasize  = torture_setting_int(tctx, "maxeasize", 65536);
 	maxeanames = torture_setting_int(tctx, "maxeanames", 101);
 	maxeastart = torture_setting_int(tctx, "maxeastart", 1);
-	maxeadebug = torture_setting_int(tctx, "maxeadebug", 0);
+	maxeadebug = torture_setting_bool(tctx, "maxeadebug", false);
 
 	/* Do some sanity check on possibly passed parms */
 	if (maxeasize <= 0) {
@@ -319,10 +319,6 @@ static bool test_max_eas(struct smbcli_state *cli, struct torture_context *tctx)
 		torture_comment(tctx, "Invalid parameter 'maxeastart=%d'",maxeastart);
 		err = true;
 	}
-	if (maxeadebug < 0) {
-		torture_comment(tctx, "Invalid parameter 'maxeadebug=%d'",maxeadebug);
-		err = true;
-	}
 	if (err) {
 	  torture_comment(tctx, "\n\n");
 	  goto done;
-- 
2.5.0


From 57d41598960324fd8cab7de92ba9b880dd9e3156 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Mon, 1 Feb 2016 16:06:18 +0100
Subject: [PATCH 2/7] s4-torture: fix gcc6 build warning.

source4/torture/ndr/drsuapi.c:272:22: warning: 'DsBind_req2_dat' defined but
not used [-Wunused-const-variable]

Guenther

Signed-off-by: Guenther Deschner <gd at samba.org>
---
 source4/torture/ndr/drsuapi.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/source4/torture/ndr/drsuapi.c b/source4/torture/ndr/drsuapi.c
index 8208020..5d26c4b 100644
--- a/source4/torture/ndr/drsuapi.c
+++ b/source4/torture/ndr/drsuapi.c
@@ -247,6 +247,7 @@ static const uint8_t DsAddEntry_resp1_dat[] = {
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 };
 
+/*
 static const uint8_t DsBind_req1_dat[] = {
   0x00, 0x00, 0x02, 0x00, 0x9c, 0xb9, 0xfa, 0x6a, 0x26, 0x6e, 0x4a, 0x46,
   0x97, 0x5f, 0xf5, 0x8f, 0x10, 0x52, 0x18, 0xbc, 0x04, 0x00, 0x02, 0x00,
@@ -259,6 +260,7 @@ static const uint8_t DsBind_req1_dat[] = {
   0xeb, 0x1c, 0xc9, 0x11, 0x9f, 0xe8, 0x08, 0x00, 0x2b, 0x10, 0x48, 0x60,
   0x02, 0x00, 0x00, 0x00
 };
+*/
 
 static const uint8_t DsBind_resp1_dat[] = {
   0x00, 0x00, 0x02, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00,
@@ -269,6 +271,7 @@ static const uint8_t DsBind_resp1_dat[] = {
   0x00, 0x00, 0x00, 0x00
 };
 
+/*
 static const uint8_t DsBind_req2_dat[] = {
   0x00, 0x00, 0x02, 0x00, 0x9c, 0xb9, 0xfa, 0x6a, 0x26, 0x6e, 0x4a, 0x46,
   0x97, 0x5f, 0xf5, 0x8f, 0x10, 0x52, 0x18, 0xbc, 0x04, 0x00, 0x02, 0x00,
@@ -277,6 +280,7 @@ static const uint8_t DsBind_req2_dat[] = {
   0x15, 0xe3, 0x87, 0xe8, 0xfc, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00
 };
+*/
 
 static const uint8_t DsBind_resp2_dat[] = {
   0x00, 0x00, 0x02, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00,
-- 
2.5.0


From 6ba3d0fbfdc055841dff33c8f1b2aecec0fb7f0d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Fri, 5 Feb 2016 11:32:17 +0100
Subject: [PATCH 3/7] s4-torture: fix gcc6 build warning.

source4/torture/ndr/samr.c:277:22: warning:
'samr_changepassworduser3_w2k_out_data' defined but not used
[-Wunused-const-variable]

Guenther

Signed-off-by: Guenther Deschner <gd at samba.org>
---
 source4/torture/ndr/samr.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/source4/torture/ndr/samr.c b/source4/torture/ndr/samr.c
index 91bb4d7..9f2f8ee 100644
--- a/source4/torture/ndr/samr.c
+++ b/source4/torture/ndr/samr.c
@@ -274,9 +274,11 @@ static const uint8_t samr_changepassworduser3_w2k_in_data[] = {
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 };
 
+/*
 static const uint8_t samr_changepassworduser3_w2k_out_data[] = {
 	0xbb, 0x00, 0x00, 0xc0
 };
+*/
 
 static const uint8_t samr_changepassworduser3_w2k8r2_out_data[] = {
 	0x00, 0x00, 0x02, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
-- 
2.5.0


From dbf5afe5e7988a9bdc58e720885bd4844e9b6963 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Fri, 5 Feb 2016 11:33:32 +0100
Subject: [PATCH 4/7] s4-torture: fix gcc6 build warning.

source4/torture/rpc/forest_trust.c:408:22: warning: 'my_blob' defined but not
used [-Wunused-const-variable]

Guenther

Signed-off-by: Guenther Deschner <gd at samba.org>
---
 source4/torture/rpc/forest_trust.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/source4/torture/rpc/forest_trust.c b/source4/torture/rpc/forest_trust.c
index ccb19ed..214b690 100644
--- a/source4/torture/rpc/forest_trust.c
+++ b/source4/torture/rpc/forest_trust.c
@@ -405,6 +405,7 @@ static bool delete_trusted_domain_by_sid(struct dcerpc_pipe *p,
 	return true;
 }
 
+/*
 static const uint8_t my_blob[] = {
 0xa3,0x0b,0x32,0x45,0x8b,0x84,0x3b,0x01,0x68,0xe8,0x2b,0xbb,0x00,0x13,0x69,0x1f,
 0x10,0x35,0x72,0xa9,0x4f,0x77,0xb7,0xeb,0x59,0x08,0x07,0xc3,0xe8,0x17,0x00,0xc5,
@@ -445,7 +446,7 @@ static const uint8_t my_blob[] = {
 0x14,0x00,0x00,0x00,0x31,0x00,0x32,0x00,0x33,0x00,0x34,0x00,0x35,0x00,0x36,0x00,
 0x37,0x00,0x38,0x00,0x39,0x00,0x30,0x00,0x30,0x00,0x00,0x00,0x30,0x00,0x00,0x00
 };
-
+*/
 static bool get_trust_domain_passwords_auth_blob(TALLOC_CTX *mem_ctx,
 						 const char *password,
 						 DATA_BLOB *auth_blob)
-- 
2.5.0


From 7306f810ae0644686f2d3f4d1e3e125d8faf7d62 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Fri, 5 Feb 2016 11:36:15 +0100
Subject: [PATCH 5/7] s4-torture: fix gcc6 build warnings.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

source4/torture/nbt/winsreplication.c:523:30: warning: 'addresses_X_1_2' defined but not used [-Wunused-const-variable]
source4/torture/nbt/winsreplication.c:470:30: warning: 'addresses_B_2' defined but not used [-Wunused-const-variable]
source4/torture/nbt/winsreplication.c:445:30: warning: 'addresses_A_3_4_X_1_2' defined but not used [-Wunused-const-variable]

Guenther

Signed-off-by: Günther Deschner <gd at samba.org>
---
 source4/torture/nbt/winsreplication.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c
index e76e816..e1d4b93 100644
--- a/source4/torture/nbt/winsreplication.c
+++ b/source4/torture/nbt/winsreplication.c
@@ -441,7 +441,7 @@ static const struct wrepl_ip addresses_A_3_4_X_3_4_OWNER_B[] = {
 	.ip	= TEST_ADDRESS_X_PREFIX".4"
 	}
 };
-
+/*
 static const struct wrepl_ip addresses_A_3_4_X_1_2[] = {
 	{
 	.owner	= TEST_OWNER_A_ADDRESS,
@@ -460,19 +460,21 @@ static const struct wrepl_ip addresses_A_3_4_X_1_2[] = {
 	.ip	= TEST_ADDRESS_X_PREFIX".2"
 	}
 };
-
+*/
 static const struct wrepl_ip addresses_B_1[] = {
 	{
 	.owner	= TEST_OWNER_B_ADDRESS,
 	.ip	= TEST_ADDRESS_B_PREFIX".1"
 	}
 };
+/*
 static const struct wrepl_ip addresses_B_2[] = {
 	{
 	.owner	= TEST_OWNER_B_ADDRESS,
 	.ip	= TEST_ADDRESS_B_PREFIX".2"
 	}
 };
+*/
 static const struct wrepl_ip addresses_B_3_4[] = {
 	{
 	.owner	= TEST_OWNER_B_ADDRESS,
@@ -520,6 +522,7 @@ static const struct wrepl_ip addresses_B_3_4_X_1_2[] = {
 	}
 };
 
+/*
 static const struct wrepl_ip addresses_X_1_2[] = {
 	{
 	.owner	= TEST_OWNER_X_ADDRESS,
@@ -530,6 +533,8 @@ static const struct wrepl_ip addresses_X_1_2[] = {
 	.ip	= TEST_ADDRESS_X_PREFIX".2"
 	}
 };
+*/
+
 static const struct wrepl_ip addresses_X_3_4[] = {
 	{
 	.owner	= TEST_OWNER_X_ADDRESS,
-- 
2.5.0


From 983019b22cca8ec98a7f4d30d7f8acf2e8a5716a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Fri, 5 Feb 2016 11:37:45 +0100
Subject: [PATCH 6/7] s4-libgpo: fix gcc6 build warning.

source4/lib/policy/gp_ldap.c:48:35: warning: 'gpo_inheritance' defined but not
used [-Wunused-const-variable]

Guenther

Signed-off-by: Guenther Deschner <gd at samba.org>
---
 source4/lib/policy/gp_ldap.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/source4/lib/policy/gp_ldap.c b/source4/lib/policy/gp_ldap.c
index ee7c07f..5c3f8e9 100644
--- a/source4/lib/policy/gp_ldap.c
+++ b/source4/lib/policy/gp_ldap.c
@@ -45,12 +45,13 @@ static const struct gpo_stringmap gpo_flags [] = {
 	{ "GPO_FLAG_MACHINE_DISABLE", GPO_FLAG_MACHINE_DISABLE },
 	{ NULL, 0 }
 };
+/*
 static const struct gpo_stringmap gpo_inheritance [] = {
 	{ "GPO_INHERIT", GPO_INHERIT },
 	{ "GPO_BLOCK_INHERITANCE", GPO_BLOCK_INHERITANCE },
 	{ NULL, 0 }
 };
-
+*/
 
 static NTSTATUS parse_gpo(TALLOC_CTX *mem_ctx, struct ldb_message *msg, struct gp_object **ret)
 {
-- 
2.5.0


From 3d2aa874ce540c5d1e0bd29ae7708de3365d6cd0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd at samba.org>
Date: Fri, 5 Feb 2016 11:39:46 +0100
Subject: [PATCH 7/7] ctdb/server: fix gcc6 build warning.

ctdb/server/ipalloc_lcp2.c:264:29: warning: 'minimbl' may be used uninitialized
in this function [-Wmaybe-uninitialized]

Guenther

Signed-off-by: Guenther Deschner <gd at samba.org>
---
 ctdb/server/ipalloc_lcp2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ctdb/server/ipalloc_lcp2.c b/ctdb/server/ipalloc_lcp2.c
index 0dd9364..066e421 100644
--- a/ctdb/server/ipalloc_lcp2.c
+++ b/ctdb/server/ipalloc_lcp2.c
@@ -201,7 +201,7 @@ static void lcp2_allocate_unassigned(struct ipalloc_state *ipalloc_state,
 	int dstnode, numnodes;
 
 	int minnode;
-	uint32_t mindsum, dstdsum, dstimbl, minimbl;
+	uint32_t mindsum, dstdsum, dstimbl, minimbl = 0;
 	struct public_ip_list *minip;
 
 	bool should_loop = true;
-- 
2.5.0



More information about the samba-technical mailing list