From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2178) id C7F403858CDA; Mon, 29 Jan 2024 22:12:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C7F403858CDA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1706566324; bh=eUagDGzHd4k+gsG6oCLC2iT/vs1JhKtYcQey+U61Iuk=; h=From:To:Subject:Date:From; b=ojbSUAMR+v04McZ31ZTPJp1se2bU19fsk43Qc7Drpz5+/SaiV3sjhuKbsRz9NI6rf cZgB2Ewl/txE3VVbJKBQmL1RSqB2gqn0o7OOnGcKbRy8qYDJrC+K3qk8q+3XMdr31G 6OgMqs8bEmKFUZ32S1bub3ydN12/ijukKGO1eai4= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Florian Weimer To: glibc-cvs@sourceware.org Subject: [glibc/release/2.37/master] sunrpc: Fix netname build with older gcc X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella Netto X-Git-Refname: refs/heads/release/2.37/master X-Git-Oldrev: bd9f194c34333c0148fc0a793b8e68e2399f27cb X-Git-Newrev: 8b8a3f0aafa30510abc5809db99c026af9a48016 Message-Id: <20240129221204.C7F403858CDA@sourceware.org> Date: Mon, 29 Jan 2024 22:12:04 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8b8a3f0aafa30510abc5809db99c026af9a48016 commit 8b8a3f0aafa30510abc5809db99c026af9a48016 Author: Adhemerval Zanella Netto Date: Mon Jul 24 14:15:23 2023 -0300 sunrpc: Fix netname build with older gcc The -Wformat-overflow was added by gcc 8. Reviewed-by: Carlos O'Donell (cherry picked from commit 0eb6b2725ba4aae73c03ac1f05c31cd2a073c99a) Diff: --- sunrpc/netname.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sunrpc/netname.c b/sunrpc/netname.c index dd2cb1b441..6641d25625 100644 --- a/sunrpc/netname.c +++ b/sunrpc/netname.c @@ -52,10 +52,14 @@ user2netname (char netname[MAXNETNAMELEN + 1], const uid_t uid, /* GCC with -Os or -O1 warns that sprint might overflow while handling dfltdom, however the above test does check if an overflow would happen. */ +#if __GNUC_PREREQ (8, 0) DIAG_PUSH_NEEDS_COMMENT; DIAG_IGNORE_NEEDS_COMMENT (8, "-Wformat-overflow"); +#endif sprintf (netname, "%s.%d@%s", OPSYS, uid, dfltdom); +#if __GNUC_PREREQ (8, 0) DIAG_POP_NEEDS_COMMENT; +#endif i = strlen (netname); if (netname[i - 1] == '.') netname[i - 1] = '\0';