From patchwork Mon Jun 17 06:35:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 33158 Received: (qmail 20209 invoked by alias); 17 Jun 2019 06:35:11 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 20200 invoked by uid 89); 17 Jun 2019 06:35:11 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=H*r:sk:libc-al X-HELO: mx0a-001b2d01.pphosted.com To: GNU C Library From: Stefan Liebler Subject: [PATCH] Fix gcc 9 build errors for make xcheck. Date: Mon, 17 Jun 2019 08:35:01 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 x-cbid: 19061706-4275-0000-0000-00000342EBF0 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19061706-4276-0000-0000-000038530D76 Message-Id: Hi, this patch fixes the following gcc 9 warnings for "make xcheck": -string/tst-strcasestr.c: ../include/bits/../../misc/bits/error.h:42:5: error: ‘%s’ directive argument is null [-Werror=format-overflow=] -argp/argp-test.c: argp-test.c:130:20: error: ‘%d’ directive writing between 1 and 11 bytes into a region of size 10 [-Werror=format-overflow=] argp-test.c:130:19: note: directive argument in the range [-2147483648, 122] argp-test.c:130:5: note: ‘sprintf’ output between 2 and 12 bytes into a destination of size 10 -nss/tst-field.c: tst-field.c:52:7: error: ‘%s’ directive argument is null [-Werror=format-overflow=] Bye Stefan ChangeLog: * string/test-strcasestr.c (check_result): Add NULL check. * nss/tst-field.c (check_rewrite): Likewise. * argp/argp-test.c (popt): Increase size of buf to 12. commit 4b7c870e47625e91f89258bd8e3cd3ca51787556 Author: Stefan Liebler Date: Fri Jun 14 12:47:39 2019 +0200 Fix gcc 9 build errors for make xcheck. This patch fixes the following gcc 9 warnings for "make xcheck": -string/tst-strcasestr.c: ../include/bits/../../misc/bits/error.h:42:5: error: ‘%s’ directive argument is null [-Werror=format-overflow=] -argp/argp-test.c: argp-test.c:130:20: error: ‘%d’ directive writing between 1 and 11 bytes into a region of size 10 [-Werror=format-overflow=] argp-test.c:130:19: note: directive argument in the range [-2147483648, 122] argp-test.c:130:5: note: ‘sprintf’ output between 2 and 12 bytes into a destination of size 10 -nss/tst-field.c: tst-field.c:52:7: error: ‘%s’ directive argument is null [-Werror=format-overflow=] ChangeLog: * string/test-strcasestr.c (check_result): Add NULL check. * nss/tst-field.c (check_rewrite): Likewise. * argp/argp-test.c (popt): Increase size of buf to 12. diff --git a/argp/argp-test.c b/argp/argp-test.c index cb2976ddad..13e0c6df14 100644 --- a/argp/argp-test.c +++ b/argp/argp-test.c @@ -123,7 +123,7 @@ static const char doc[] = "Test program for argp." static void popt (int key, char *arg) { - char buf[10]; + char buf[12]; if (isprint (key)) sprintf (buf, "%c", key); else diff --git a/nss/tst-field.c b/nss/tst-field.c index 23d2f2abf6..5c553e5f46 100644 --- a/nss/tst-field.c +++ b/nss/tst-field.c @@ -50,7 +50,7 @@ check_rewrite (const char *input, const char *expected) if (result != NULL && strcmp (result, expected) != 0) { printf ("FAIL: rewrite \"%s\" -> \"%s\", expected \"%s\"\n", - input, result, expected); + (input == NULL) ? "NULL" : input, result, expected); errors = true; } free (to_free); diff --git a/string/test-strcasestr.c b/string/test-strcasestr.c index 0a16f85dcd..1773581a3e 100644 --- a/string/test-strcasestr.c +++ b/string/test-strcasestr.c @@ -67,7 +67,7 @@ check_result (impl_t *impl, const char *s1, const char *s2, if (result != exp_result) { error (0, 0, "Wrong result in function %s %s %s", impl->name, - result, exp_result); + result, (exp_result == NULL) ? "NULL" : exp_result); ret = 1; return -1; }