From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x236.google.com (mail-oi1-x236.google.com [IPv6:2607:f8b0:4864:20::236]) by sourceware.org (Postfix) with ESMTPS id 086473858D35 for ; Thu, 29 Dec 2022 12:58:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 086473858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oi1-x236.google.com with SMTP id r205so17067442oib.9 for ; Thu, 29 Dec 2022 04:58:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=GPDs69iUO1vEzzFJS8fxlUpNUaYMNDNQh4+2pNfCkX8=; b=KB2WpTqZQ0/verG95KK6JO3qe2wJzGthwBoYr+U+njlDlEQ7c5LP5o5xbPrielcGQc VRrg1YJzD7i745AfQ7MpJ8UjBb+ezLiiT9ekeU28MmQeXTY7bhyppXqAel4d1F5BJAI+ xSNkN56/vKyrhAs09BLyWEFGCMyvIcpDx6wvNvXxCDa3/GPvW344DHW7JbJNJGl4xjbd qniSkL+05z83W7OaxiNl/lLKn817NALNxMJ6Dx5P2hTmUrZkMFMJQGObRns5wF7CLbJf t5TaZWgoeoTJrzOFx29Ja4zu8mQCDjDP3Ezp8lp4VY5Psz2fqOgbgAhXqc3CBf0tkfJn kMhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GPDs69iUO1vEzzFJS8fxlUpNUaYMNDNQh4+2pNfCkX8=; b=XcdRo40XIqiY6Duw36Sf0BlP+SOAoTGIEFHAohNqgw9H1wYkI8gvdPP9RZQkYEjijR NbgBCOwlepeFuFm0bbRK5dhaKCO3Zn+HvNVIlw6EgKFRx4OYPzyxYoGL1Ak7YiXhArtT Vzutat/Q83oX1NETF+EMchFtH0A2urfhCOlEWEm8bHkOX3/xabD0yExPa8fKxehC2dge u/SQqbtUAss0QPbMQcGL1c7EXNllH4BedeMump1XhVLerdXYT7kK1Qh5cUpHFrFlTF7n 3+azS1v69BL7XxrMVcRZPLsOEQ4hJKpJerqO1VCsuY6mMfv/8VNVZ5HegOggMWKqt5Tl TzGA== X-Gm-Message-State: AFqh2kpu+0WhJMrxZtW1/YvP6tZ8nMzGfjfpwO/4Ds4yRiSPiuPoTlPb aOZTsFtYiH3TfV5QA+2EGdNhCSfub2ST4QZabbo= X-Google-Smtp-Source: AMrXdXu6pAFHbcJ3REpk8qMSXt6CHcJwNLwb85uIlkVfqmV8B9RKKCI+yDu3Acy85riR92KZVrOiRw== X-Received: by 2002:a05:6808:19aa:b0:35c:3a6e:bc34 with SMTP id bj42-20020a05680819aa00b0035c3a6ebc34mr18745186oib.57.1672318690241; Thu, 29 Dec 2022 04:58:10 -0800 (PST) Received: from mandiga.. ([2804:1b3:a7c3:dd36:4794:7acd:a716:7b01]) by smtp.gmail.com with ESMTPSA id j2-20020a9d7d82000000b0066c34486aa7sm8977378otn.73.2022.12.29.04.58.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Dec 2022 04:58:09 -0800 (PST) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH 2/4] sunrpc: Suppress GCC -O1 warning on user2netname [BZ #19444] Date: Thu, 29 Dec 2022 09:58:00 -0300 Message-Id: <20221229125802.2715435-3-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221229125802.2715435-1-adhemerval.zanella@linaro.org> References: <20221229125802.2715435-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: The same issue described by 6128e82ebe973163d2dd614d31753c88c0c4d645 also happend with -O1. Checked on x86_64-linux-gnu. --- sunrpc/netname.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sunrpc/netname.c b/sunrpc/netname.c index c1d1c43e50..a10591c071 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); -- 2.34.1