Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp73229rdb; Wed, 1 Nov 2023 17:41:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFovdXwTknQq0WmExLhJaz1AL1/7mSCpsz7hol982CDKxYgsDEdAaqRD6PKR89IxIrQtwM4 X-Received: by 2002:a17:903:2883:b0:1cc:3598:4ba0 with SMTP id ku3-20020a170903288300b001cc35984ba0mr8877434plb.68.1698885714178; Wed, 01 Nov 2023 17:41:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698885714; cv=none; d=google.com; s=arc-20160816; b=ubSu8Bm23g/WVFL3K2i77AM4HdtCmTT9eAmpDUrlnny8DyFA7jMk3mLQWiUsiY1iFN 0l1JujS2KT13iauK4MX5bcN0XZaFzDiXLSaMpFZ+rYfpwtPxVOHPwUuJ9+Nugm/+OetN cVZoPK6komWGxSP7Pi+tvH9asPDsI7CtCshwuzM2JKjiI+0huUy8th+ZKgTIcMFGOkIS SzP6CoxvHEbXuJ5X9RisQdmewpOAFCDTR+H+7hC4P0fPK16bqw+CRwhDNSp3Li0I6MGE vbkd9BFdw9bTDB75Bd8gfY9hHvYxeUc++Y/RZ1pGJibxNPkMeKdIKAI8cscWjGBlUg62 mwHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=PAmpgjdK8hmw86qRod49rM//sCJ8Bz8+YBV91rFwGG4=; fh=IzgU6vW9dNoqCaZpZRK1gVV7M01sX00CjXz8KPJWooI=; b=ux1Ynj0sC+mzPv6fMgx/Mcm4jFHSFZZo/8C2Xc2UovPN60uPCKiWeXLkJrUUUVyWJ5 RKgCotB0CcOq330XcpMczZeYotnsE3JOWkgy27w4C1OCUrJK4s5qyG8xNOTM8D5j2ixh O7mq4W/yE1iXP9m59uZd0tFw8dYl1slSZ/3nr3Qnp0RWzhwMWbHrXLpeINcmPfY3zg4q yst8Ur3gQvINoqmPhziol56gIPz0hmC8LcasixrgD96o/R48iHZ6dIPtrgPBV1KE9tR7 tYl12o92tuK/ThYtNxUPxWZihbke5dmfRI7g75gJObokHI+OmrPYXC0XeHz9N9V2Xk8J 0DZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dabbelt-com.20230601.gappssmtp.com header.s=20230601 header.b=pmRqAN68; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id l11-20020a170903244b00b001cc467a339esi4410714pls.389.2023.11.01.17.41.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 17:41:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@dabbelt-com.20230601.gappssmtp.com header.s=20230601 header.b=pmRqAN68; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id BBAB980C6E98; Wed, 1 Nov 2023 17:41:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234607AbjKBAlR (ORCPT + 99 others); Wed, 1 Nov 2023 20:41:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230502AbjKBAlQ (ORCPT ); Wed, 1 Nov 2023 20:41:16 -0400 Received: from mail-oa1-x31.google.com (mail-oa1-x31.google.com [IPv6:2001:4860:4864:20::31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB74E113 for ; Wed, 1 Nov 2023 17:41:11 -0700 (PDT) Received: by mail-oa1-x31.google.com with SMTP id 586e51a60fabf-1dd1714b9b6so274235fac.0 for ; Wed, 01 Nov 2023 17:41:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20230601.gappssmtp.com; s=20230601; t=1698885671; x=1699490471; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:from:to:cc:subject:date:message-id :reply-to; bh=PAmpgjdK8hmw86qRod49rM//sCJ8Bz8+YBV91rFwGG4=; b=pmRqAN68uA/Z+sMMnSXl8Vq1vVwhLK0wu4dZKngIJHgdls8NWpwRc0eH1l4einry14 yJ5O9IxPQ6fvGbC+xHtD6mzff5OEYFRYrgFuy75tBX1kLlmAHwoZ+OBd4EarNNPGQ5zV Z9dL1+jfk7VmScDUdeYCCDir/OzPIh8gMa+23zPVD4MujDfwGUKKuYlUccAOd4y9GDpN 1rFip/8WBKwGAqt+A5Fh9SPq1U9wPeUxiN0KBfanHnaVHrn2ew50EJtv5wzmMhSvOS0S QFDogJzqR3+36UXf6arBW/k3pVPm7rTEEbC89JQjT5yUnMwkDMRvcGyhTCSKg8/aAeVI /+TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698885671; x=1699490471; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=PAmpgjdK8hmw86qRod49rM//sCJ8Bz8+YBV91rFwGG4=; b=nhSeoTQVzlrLj35TOmeucKj33VF/E5NL2o4RpruJLr8tWcVJ9jxEMXIjPFttL6yOmA SA6+xiJHAb4e8xUCqvEVR2nAOxBGhIbL33BTCFgQSixva6Qm0hxCDIZea07mb4hFuFJD 6OYzC/TWCzjfvW4OH3xgO4YPURCk+FGh0mJdGEmlNPD0ATThVuYft9bG0HVnDPtwta7O wXkW0KU6e3dPCsjMYKFO7mEoJGwVMGoOdQR3866FblKbMNqEfivnjb7FsJhkxOx8lzKN juoVD78ViUiXytghygZHJGB1iuwisz2TWJGRe86LWgKAJzLd3Tasn5bO/WJPBnHw9STz yotg== X-Gm-Message-State: AOJu0YwDxQZQBfFMcG1J+EKskPYepsIJ/niUqDZwDo/+Rry6kwB3SaTh 7CrADVjPZpExInuAJ7eL6AyhtA== X-Received: by 2002:a05:6871:528e:b0:1ea:6883:9a01 with SMTP id hu14-20020a056871528e00b001ea68839a01mr24276948oac.32.1698885670962; Wed, 01 Nov 2023 17:41:10 -0700 (PDT) Received: from localhost ([12.44.203.122]) by smtp.gmail.com with ESMTPSA id s15-20020a63b40f000000b00588e8421fa8sm308240pgf.84.2023.11.01.17.41.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 17:41:10 -0700 (PDT) Date: Wed, 01 Nov 2023 17:41:10 -0700 (PDT) X-Google-Original-Date: Wed, 01 Nov 2023 17:31:33 PDT (-0700) Subject: Re: [PATCH net] tcp: Fix -Wc23-extensions in tcp_options_write() In-Reply-To: <20231031-tcp-ao-fix-label-in-compound-statement-warning-v1-1-c9731d115f17@kernel.org> CC: edumazet@google.com, davem@davemloft.net, dsahern@kernel.org, kuba@kernel.org, pabeni@redhat.com, ndesaulniers@google.com, trix@redhat.com, 0x7f454c46@gmail.com, fruggeri@arista.com, noureddine@arista.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, patches@lists.linux.dev, nathan@kernel.org From: Palmer Dabbelt To: nathan@kernel.org Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 01 Nov 2023 17:41:47 -0700 (PDT) On Tue, 31 Oct 2023 13:23:35 PDT (-0700), nathan@kernel.org wrote: > Clang warns (or errors with CONFIG_WERROR=y) when CONFIG_TCP_AO is set: > > net/ipv4/tcp_output.c:663:2: error: label at end of compound statement is a C23 extension [-Werror,-Wc23-extensions] > 663 | } > | ^ > 1 error generated. > > On earlier releases (such as clang-11, the current minimum supported > version for building the kernel) that do not support C23, this was a > hard error unconditionally: > > net/ipv4/tcp_output.c:663:2: error: expected statement > } > ^ > 1 error generated. > > Add a semicolon after the label to create an empty statement, which > resolves the warning or error for all compilers. > > Closes: https://github.com/ClangBuiltLinux/linux/issues/1953 > Fixes: 1e03d32bea8e ("net/tcp: Add TCP-AO sign to outgoing packets") > Signed-off-by: Nathan Chancellor > --- > net/ipv4/tcp_output.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c > index f558c054cf6e..6064895daece 100644 > --- a/net/ipv4/tcp_output.c > +++ b/net/ipv4/tcp_output.c > @@ -658,7 +658,7 @@ static void tcp_options_write(struct tcphdr *th, struct tcp_sock *tp, > memset(ptr, TCPOPT_NOP, sizeof(*ptr)); > ptr++; > } > -out_ao: > +out_ao:; > #endif > } > if (unlikely(opts->mss)) { > > --- > base-commit: 55c900477f5b3897d9038446f72a281cae0efd86 > change-id: 20231031-tcp-ao-fix-label-in-compound-statement-warning-ebd6c9978498 > > Best regards, This gives me a linux/net/ipv4/tcp_output.c:663:2: error: expected statement } on GCC for me. So I think something like diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index f558c054cf6e..ca09763acaa8 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -659,6 +659,11 @@ static void tcp_options_write(struct tcphdr *th, struct tcp_sock *tp, ptr++; } out_ao: + /* + * Labels at the end of compound statements are a C23 feature, so + * introduce a block to avoid a warning/error on strict toolchains. + */ + {} #endif } if (unlikely(opts->mss)) { should do it (though it's still build testing...)