From 54f29649db3b92737c0cb756594fe6801142a150 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 1 Jun 2017 14:16:56 +0200 Subject: [PATCH 1/4] replace: Use the same size as d_name member of struct dirent This fixes an error with GCC 7.1 BUG: https://bugzilla.samba.org/show_bug.cgi?id=12827 Signed-off-by: Andreas Schneider Reviewed-by: Jeremy Allison (cherry picked from commit 94e21c139f9b0c1d28ee85fdcb9b7490cc64e27b) --- lib/replace/test/os2_delete.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/replace/test/os2_delete.c b/lib/replace/test/os2_delete.c index 0816f611516..4b99ccf9103 100644 --- a/lib/replace/test/os2_delete.c +++ b/lib/replace/test/os2_delete.c @@ -63,7 +63,7 @@ static int os2_delete(DIR *d) off_t offsets[READDIR_SIZE]; int i, j; struct dirent *de; - char names[READDIR_SIZE][30]; + char names[READDIR_SIZE][256]; /* scan, remembering offsets */ for (i=0, de=readdir(d); -- 2.13.0 From a55ca05dfa7cf0fe0de7ce89fa187bfdb8a9848b Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 1 Jun 2017 14:24:42 +0200 Subject: [PATCH 2/4] waf: Do not trhow a format-truncation error for test/snprintf.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes building with GCC 7.1 Error: ../lib/replace/test/testsuite.c:355:6: error: ‘%d’ directive output truncated writing 1 byte into a region of size 0 [-Werror=format-truncation=] BUG: https://bugzilla.samba.org/show_bug.cgi?id=12827 Signed-off-by: Andreas Schneider Reviewed-by: Jeremy Allison (cherry picked from commit 1670d00be88108a483f04c9763012504499b99e4) --- lib/replace/wscript | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/replace/wscript b/lib/replace/wscript index ea0d5d09b89..80e8257f9de 100644 --- a/lib/replace/wscript +++ b/lib/replace/wscript @@ -706,7 +706,8 @@ def build(bld): bld.SAMBA_SUBSYSTEM('replace-test', source='''test/testsuite.c test/strptime.c test/os2_delete.c test/getifaddrs.c''', - deps='replace') + deps='replace', + cflags="-Wno-format-zero-length -Wno-format-truncation") if bld.env.standalone_replace: bld.SAMBA_BINARY('replace_testsuite', -- 2.13.0 From 15b7b9b3f7377ffc9d2ec18aeaa5c8d3ae32df30 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 1 Jun 2017 14:28:08 +0200 Subject: [PATCH 3/4] s4:torture: Fix comparison between pointer and zero character constant Fixes building with GCC 7.1 BUG: https://bugzilla.samba.org/show_bug.cgi?id=12827 Signed-off-by: Andreas Schneider Reviewed-by: Jeremy Allison (cherry picked from commit 1f4b07e5942235bddcfa999b3575f719752d81c4) --- source4/torture/masktest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source4/torture/masktest.c b/source4/torture/masktest.c index b96c6dabbe5..50a18feb644 100644 --- a/source4/torture/masktest.c +++ b/source4/torture/masktest.c @@ -157,7 +157,7 @@ static void get_real_name(TALLOC_CTX *mem_ctx, struct smbcli_state *cli, *long_name = strlower_talloc(mem_ctx, last_hit.long_name); } - if (*short_name == '\0') { + if (*short_name[0] == '\0') { *short_name = talloc_strdup(mem_ctx, *long_name); } } -- 2.13.0 From b2d8f9071b9519f13924b7c03af1128a7d624372 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 7 Jun 2017 10:56:52 +0200 Subject: [PATCH 4/4] s4:torture: Remove duplicate const declaration specifier Fixes build with GCC 7.1 BUG: https://bugzilla.samba.org/show_bug.cgi?id=12827 Signed-off-by: Andreas Schneider Reviewed-by: Jeremy Allison --- source4/torture/ndr/string.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/source4/torture/ndr/string.c b/source4/torture/ndr/string.c index b682555dc42..2c8b83c6ae2 100644 --- a/source4/torture/ndr/string.c +++ b/source4/torture/ndr/string.c @@ -4,18 +4,18 @@ #include "../lib/util/dlinklist.h" #include "param/param.h" -static const char const *ascii = "ascii"; +static const char *ascii = "ascii"; /* the following is equivalent to "kamelåså öäüÿéèóò" in latin1 */ -static const char const latin1[] = { 0x6b, 0x61, 0x6d, 0x65, 0x6c, 0xe5, 0x73, - 0xe5, 0x20, 0xF6, 0xE4, 0xFC, 0xFF, 0xE9, - 0xE8, 0xF3, 0xF2, 0x00 }; +static const char latin1[] = { 0x6b, 0x61, 0x6d, 0x65, 0x6c, 0xe5, 0x73, + 0xe5, 0x20, 0xF6, 0xE4, 0xFC, 0xFF, 0xE9, + 0xE8, 0xF3, 0xF2, 0x00 }; /* the following is equivalent to "kamelåså ☺☺☺ öäüÿéèóò" in utf8 */ -static const char const utf8[] = { 0x6b, 0x61, 0x6d, 0x65, 0x6c, 0xc3, 0xa5, - 0x73, 0xc3, 0xa5, 0x20, 0xE2, 0x98, 0xBA, - 0xE2, 0x98, 0xBA, 0xE2, 0x98, 0xBA, 0x20, - 0xc3, 0xb6, 0xc3, 0xa4, 0xc3, 0xbc, 0xc3, - 0xbf, 0xc3, 0xa9, 0xc3, 0xa8, 0xc3, 0xb3, - 0xc3, 0xb2, 0x00 }; +static const char utf8[] = { 0x6b, 0x61, 0x6d, 0x65, 0x6c, 0xc3, 0xa5, + 0x73, 0xc3, 0xa5, 0x20, 0xE2, 0x98, 0xBA, + 0xE2, 0x98, 0xBA, 0xE2, 0x98, 0xBA, 0x20, + 0xc3, 0xb6, 0xc3, 0xa4, 0xc3, 0xbc, 0xc3, + 0xbf, 0xc3, 0xa9, 0xc3, 0xa8, 0xc3, 0xb3, + 0xc3, 0xb2, 0x00 }; /* purely for convenience */ static int fl_ascii_null = LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM; -- 2.13.0