From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 94BEC385700E; Wed, 11 Jan 2023 21:13:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 94BEC385700E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1673471595; bh=2Ftr0n/oZH+6R73mM7cQ/7a49Oubw6UvQtSTgzjFj/8=; h=From:To:Subject:Date:From; b=jusQJ0Xxac8am9YH08yw6nCB/MBsuecHFEXcXChAchS2OZNhCZGX0B7GEzZkALij4 wd9VyJBgEn10QPoOG1BnrBXMZZ+O6gqk7c/WKKuXGXhCwH+OLDE5bMUdFFy8h6s986 e8oxDRuaTIQG2MxI0wqjhMEepIJeQncchp4ZZdJU= 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] sunrpc: Suppress GCC -O1 warning on user2netname [BZ #19444] X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/master X-Git-Oldrev: 0b3503e2e19602db9cda47915d19a26c00f59bb1 X-Git-Newrev: 8176efe3cabeee003f193f6b877297bf5aee8eb6 Message-Id: <20230111211315.94BEC385700E@sourceware.org> Date: Wed, 11 Jan 2023 21:13:15 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8176efe3cabeee003f193f6b877297bf5aee8eb6 commit 8176efe3cabeee003f193f6b877297bf5aee8eb6 Author: Adhemerval Zanella Date: Thu Dec 29 09:58:00 2022 -0300 sunrpc: Suppress GCC -O1 warning on user2netname [BZ #19444] The same issue described by 6128e82ebe973163d2dd614d31753c88c0c4d645 also happend with -O1. Checked on x86_64-linux-gnu. Reviewed-by: Carlos O'Donell Diff: --- sunrpc/netname.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sunrpc/netname.c b/sunrpc/netname.c index 4fde0bf91c..dd2cb1b441 100644 --- a/sunrpc/netname.c +++ b/sunrpc/netname.c @@ -49,10 +49,11 @@ user2netname (char netname[MAXNETNAMELEN + 1], const uid_t uid, if ((strlen (dfltdom) + OPSYS_LEN + 3 + MAXIPRINT) > (size_t) MAXNETNAMELEN) return 0; - /* GCC with -Os warns that sprint might overflow while handling dfltdom, - however the above test does check if an overflow would happen. */ + /* GCC with -Os or -O1 warns that sprint might overflow while handling + dfltdom, however the above test does check if an overflow would + happen. */ DIAG_PUSH_NEEDS_COMMENT; - DIAG_IGNORE_Os_NEEDS_COMMENT (8, "-Wformat-overflow"); + DIAG_IGNORE_NEEDS_COMMENT (8, "-Wformat-overflow"); sprintf (netname, "%s.%d@%s", OPSYS, uid, dfltdom); DIAG_POP_NEEDS_COMMENT; i = strlen (netname);