From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 06824385B512; Thu, 9 Feb 2023 19:51:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 06824385B512 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675972302; bh=5StfxlgZnx0F0q4+e9SwOdP/Nj6xXRoduDijDhIDvXI=; h=From:To:Subject:Date:From; b=i9oD1Q8qQh4KvCodua5OSn0XYMdXwXatX1o+u6UCxlEhsOwgFD4Gbks07Q0OY/yF7 UF+uMoWuIkr77+o3JQ9+FFw3blvG9XlKQ1/UZQFvaHueV38O2t7Vtwex5B65st4CKB z6oyq3EuN5nmrEb0X0FaQAX6V8oq+bOmJ7huokic= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] posix: Suppress clang warning on bug-regex24 X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/clang X-Git-Oldrev: 9c4af6e72887b35516e3b864af196ddf8971f9b8 X-Git-Newrev: 54e2bd9b0ac0a51e6ee104fde4fbac32e848ca62 Message-Id: <20230209195142.06824385B512@sourceware.org> Date: Thu, 9 Feb 2023 19:51:42 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=54e2bd9b0ac0a51e6ee104fde4fbac32e848ca62 commit 54e2bd9b0ac0a51e6ee104fde4fbac32e848ca62 Author: Adhemerval Zanella Date: Fri Mar 25 11:23:35 2022 -0300 posix: Suppress clang warning on bug-regex24 clang complains that adding a 'regoff_t' to a string doe snot append to it, and the printf idea below is to make rm_so an offset. Diff: --- posix/bug-regex24.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/posix/bug-regex24.c b/posix/bug-regex24.c index 97c5c3508a..7a655cbc4d 100644 --- a/posix/bug-regex24.c +++ b/posix/bug-regex24.c @@ -1,6 +1,7 @@ #include #include #include +#include #define str "civic" @@ -45,11 +46,17 @@ do_test (void) { int len = m[i].rm_eo - m[i].rm_so; + /* clang complains that adding a 'regoff_t' to a string does not + append to it, and the printf idea below is to make rm_so as + an offset to str. */ + DIAG_PUSH_NEEDS_COMMENT_CLANG; + DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wstring-plus-int"); printf ("m[%d] = \"%.*s\"\n", i, len, str + m[i].rm_so); if (strlen (expected[i]) != len || memcmp (expected[i], str + m[i].rm_so, len) != 0) result = 1; + DIAG_POP_NEEDS_COMMENT_CLANG; } return result;