From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1962) id F21893858D32; Mon, 5 Feb 2024 14:04:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F21893858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1707141881; bh=oc0CoZO10knqt10V299tITMNRd5ztQRWliC5+PyqTFM=; h=From:To:Subject:Date:From; b=LUKIyxbNCt6Q9x57hBZWi3lEJ54jCPnu1pqCGZXVg7mTMPzGMopKZkCW6DpoZm4Me P+pIhahI4etaOEUw8FeJvNsTu6XJsckLVp8Z6PQIdfmj5FJZjPoiGx7gT55GArnJk9 kya9K7eTJuo3Zyp9p+L2EPn9YRQcMYgEpElxGQi0= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" From: Stefan Liebler To: glibc-cvs@sourceware.org Subject: [glibc] Fix stringop-overflow warning in tst-strlcat2. X-Act-Checkin: glibc X-Git-Author: Stefan Liebler X-Git-Refname: refs/heads/master X-Git-Oldrev: bbd248ac0d75efdef8fe61ea69b1fb25fb95b6e7 X-Git-Newrev: ab0db3b8849a3d4e56e30d50bc019666532b1299 Message-Id: <20240205140441.F21893858D32@sourceware.org> Date: Mon, 5 Feb 2024 14:04:41 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ab0db3b8849a3d4e56e30d50bc019666532b1299 commit ab0db3b8849a3d4e56e30d50bc019666532b1299 Author: Stefan Liebler Date: Tue Jan 16 09:44:30 2024 +0100 Fix stringop-overflow warning in tst-strlcat2. On s390x, I get warnings like this when do_one_test is inlined with SIZE_MAX: In function ‘do_one_test’, inlined from ‘do_overflow_tests’ at tst-strlcat2.c:184:2: tst-strlcat2.c:49:18: error: ‘strnlen’ specified bound [18446744073709550866, 18446744073709551615] exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=] 49 | # define STRNLEN strnlen | ^ tst-strlcat2.c:89:23: note: in expansion of macro ‘STRNLEN’ 89 | size_t dst_length = STRNLEN (dst, n); | ^~~~~~~ This patch just marks the do_one_test function as noinline as also done in test-strncat.c: Fix stringop-overflow warning in test-strncat. https://sourceware.org/git/?p=glibc.git;a=commit;h=51aeab9a363a0d000d0912aa3d6490463a26fba2 Diff: --- string/tst-strlcat2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/string/tst-strlcat2.c b/string/tst-strlcat2.c index 225520a46b..1ec26a2432 100644 --- a/string/tst-strlcat2.c +++ b/string/tst-strlcat2.c @@ -81,6 +81,7 @@ IMPL (STRLCAT, 1) typedef size_t (*proto_t) (CHAR *, const CHAR *, size_t); static void +__attribute__((noinline)) do_one_test (impl_t *impl, CHAR *dst, const CHAR *src, size_t n) {