From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2E50C53A4; Mon, 28 Feb 2022 11:58:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8DE8C340F2; Mon, 28 Feb 2022 11:58:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646049492; bh=+wvb9UMyXw53TgaflmlowqbBW5U339MQvEG61L0RkPg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=UlCStjXbnIL+tfRuh3M8eOd/h3mUpwJ+nEULnaK4vf3kxoiCEv5i0xND3ezpVA1NJ asbmtDFOlir3ENKdd5FtudHAFpICftoFAjg6pKnlneSMDx4MEcMsA7vyUakbeSXT3X nUFP3khnYZ3qbJmCpnLt55WnwxVSwm68nX+ZoeTqoOeNVMtaEKy9cV8dRI1jifZvRs 3d8GMkEbETN4Ra3aEXU+hnLTNMO6DC9y8V8wZcQ/VhkpJgOkBR6F1J/pdElsRBECPA +TJ6HAZgwTGJzbkY9pLdTcNwhjqMu8BzqcPR/E1tqcUQ16+HSU3jxayRCKNIOXQOOa RK7ioBNniwedQ== Received: by mail-wr1-f47.google.com with SMTP id n14so15021986wrq.7; Mon, 28 Feb 2022 03:58:12 -0800 (PST) X-Gm-Message-State: AOAM530AGtSvKXqf81wslNTjomZVSp+2aahxn2dw0WfiF3M+MaZziJ5T vjtoZmmQar8uSDkHh1vWom/ITl5xXeFYIDfyafE= X-Google-Smtp-Source: ABdhPJwy6iIN+2EltyCCG8tEZNqW13aNO74dzYWDQrDlYbSLva54a7gegIjmFcrq6DWR6/fwUhMsaBFj3vOKpR4gr9Q= X-Received: by 2002:adf:edc3:0:b0:1ec:5f11:5415 with SMTP id v3-20020adfedc3000000b001ec5f115415mr13633412wro.317.1646049491206; Mon, 28 Feb 2022 03:58:11 -0800 (PST) Precedence: bulk X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20220228103142.3301082-1-arnd@kernel.org> In-Reply-To: From: Arnd Bergmann Date: Mon, 28 Feb 2022 12:57:55 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] [v2] Kbuild: move to -std=gnu11 To: Marco Elver Cc: Linux Kbuild mailing list , Arnd Bergmann , Linus Torvalds , Masahiro Yamada , llvm@lists.linux.dev, Jonathan Corbet , Federico Vaga , Alex Shi , Hu Haowen , Michal Marek , Nick Desaulniers , "open list:DOCUMENTATION" , Linux Kernel Mailing List , linux-doc-tw-discuss@lists.sourceforge.net, Linux ARM , Intel Graphics , dri-devel , greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev, linux-btrfs , Mark Rutland Content-Type: text/plain; charset="UTF-8" On Mon, Feb 28, 2022 at 12:47 PM Marco Elver wrote: > On Mon, 28 Feb 2022 at 11:32, Arnd Bergmann wrote: > > > Nathan Chancellor reported an additional -Wdeclaration-after-statement > > warning that appears in a system header on arm, this still needs a > > workaround. > > On the topic of Wdeclaration-after-statement, Clang only respects this > warning with C99 and later starting with Clang 14: > https://github.com/llvm/llvm-project/commit/c65186c89f35#diff-ec770381d76c859f5f572db789175fe44410a72608f58ad5dbb14335ba56eb97R61 > > Until Clang 14, -Wdeclaration-after-statement is ignored by Clang in > newer standards. If this is a big problem, we can probably convince > the Clang stable folks to backport the fixes. However, the build won't > fail, folks might just miss the warning if they don't also test with > GCC. I don't expect this is to be a big issue, as long as the latest clang behaves as expected. There are many warnings that are only produced by one of the two compilers, so this is something we already deal with. I think it's more important to address the extra warning that Nathan reported, where clang now complains about the intermingled declaration in a system header when previously neither gcc nor clang noticed this. > > The differences between gnu99, gnu11, gnu1x and gnu17 are fairly > > minimal and mainly impact warnings at the -Wpedantic level that the > > kernel never enables. Between these, gnu11 is the newest version > > that is supported by all supported compiler versions, though it is > > only the default on gcc-5, while all other supported versions of > > gcc or clang default to gnu1x/gnu17. > > > > Link: https://lore.kernel.org/lkml/CAHk-=wiyCH7xeHcmiFJ-YgXUy2Jaj7pnkdKpcovt8fYbVFW3TA@mail.gmail.com/ > > Link: https://github.com/ClangBuiltLinux/linux/issues/1603 > > Suggested-by: Linus Torvalds > > Cc: Masahiro Yamada > > Cc: linux-kbuild@vger.kernel.org > > Cc: llvm@lists.linux.dev > > Signed-off-by: Arnd Bergmann > > Acked-by: Marco Elver Thanks, Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 93034C4332F for ; Mon, 28 Feb 2022 11:58:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B87D310E626; Mon, 28 Feb 2022 11:58:18 +0000 (UTC) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9BCC010E626; Mon, 28 Feb 2022 11:58:16 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4B9CEB81109; Mon, 28 Feb 2022 11:58:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08F68C340FA; Mon, 28 Feb 2022 11:58:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646049493; bh=+wvb9UMyXw53TgaflmlowqbBW5U339MQvEG61L0RkPg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=dKnUYFqwp2nljzB9HyNzLWj4aTyNWXVZA+BytLq5D7XB/wn2bgjZiMOaqskVpLuiD bk1rXCLmdHoF9yjad0YHG+aChMto6BWqkOaSNkASogtC0xwnUDMGmRpKWwbUUHIN9G T2jY86/3NyMp3QaiaqAGDioEuxukYv9eQ1s5RlKdtbtoQzRo06NdJeugzhX7GPJJPU 4H6CnJkW0b+1gc1ha/tl8+JooMzw6m0qyd4IheUg8d+VSgFqd3J4We8CPaaoborU6O 8ENUz+sQQa6Y+L8l2JDIzlj6xsFuwZlKFvfhceBVVAHW1OeYHoq8q01WwDXvR36vjs Kk7LHoUofOmAg== Received: by mail-wr1-f49.google.com with SMTP id s13so15050295wrb.6; Mon, 28 Feb 2022 03:58:12 -0800 (PST) X-Gm-Message-State: AOAM531jD02q3w3cBPWV0YFg3nsFDpQcNWuo1+qEmaZ7+eW3cWSf0qbJ 0fnSw0blknB8mlu7NdwVpf9E//HX7pUEaIVnptI= X-Google-Smtp-Source: ABdhPJwy6iIN+2EltyCCG8tEZNqW13aNO74dzYWDQrDlYbSLva54a7gegIjmFcrq6DWR6/fwUhMsaBFj3vOKpR4gr9Q= X-Received: by 2002:adf:edc3:0:b0:1ec:5f11:5415 with SMTP id v3-20020adfedc3000000b001ec5f115415mr13633412wro.317.1646049491206; Mon, 28 Feb 2022 03:58:11 -0800 (PST) MIME-Version: 1.0 References: <20220228103142.3301082-1-arnd@kernel.org> In-Reply-To: From: Arnd Bergmann Date: Mon, 28 Feb 2022 12:57:55 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] [v2] Kbuild: move to -std=gnu11 To: Marco Elver Content-Type: text/plain; charset="UTF-8" X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux ARM , Mark Rutland , Michal Marek , "open list:DOCUMENTATION" , Arnd Bergmann , Jonathan Corbet , linux-staging@lists.linux.dev, Masahiro Yamada , llvm@lists.linux.dev, Nick Desaulniers , Linux Kernel Mailing List , dri-devel , greybus-dev@lists.linaro.org, Alex Shi , Federico Vaga , Hu Haowen , Intel Graphics , linux-btrfs , Linus Torvalds , linux-doc-tw-discuss@lists.sourceforge.net, Linux Kbuild mailing list Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Mon, Feb 28, 2022 at 12:47 PM Marco Elver wrote: > On Mon, 28 Feb 2022 at 11:32, Arnd Bergmann wrote: > > > Nathan Chancellor reported an additional -Wdeclaration-after-statement > > warning that appears in a system header on arm, this still needs a > > workaround. > > On the topic of Wdeclaration-after-statement, Clang only respects this > warning with C99 and later starting with Clang 14: > https://github.com/llvm/llvm-project/commit/c65186c89f35#diff-ec770381d76c859f5f572db789175fe44410a72608f58ad5dbb14335ba56eb97R61 > > Until Clang 14, -Wdeclaration-after-statement is ignored by Clang in > newer standards. If this is a big problem, we can probably convince > the Clang stable folks to backport the fixes. However, the build won't > fail, folks might just miss the warning if they don't also test with > GCC. I don't expect this is to be a big issue, as long as the latest clang behaves as expected. There are many warnings that are only produced by one of the two compilers, so this is something we already deal with. I think it's more important to address the extra warning that Nathan reported, where clang now complains about the intermingled declaration in a system header when previously neither gcc nor clang noticed this. > > The differences between gnu99, gnu11, gnu1x and gnu17 are fairly > > minimal and mainly impact warnings at the -Wpedantic level that the > > kernel never enables. Between these, gnu11 is the newest version > > that is supported by all supported compiler versions, though it is > > only the default on gcc-5, while all other supported versions of > > gcc or clang default to gnu1x/gnu17. > > > > Link: https://lore.kernel.org/lkml/CAHk-=wiyCH7xeHcmiFJ-YgXUy2Jaj7pnkdKpcovt8fYbVFW3TA@mail.gmail.com/ > > Link: https://github.com/ClangBuiltLinux/linux/issues/1603 > > Suggested-by: Linus Torvalds > > Cc: Masahiro Yamada > > Cc: linux-kbuild@vger.kernel.org > > Cc: llvm@lists.linux.dev > > Signed-off-by: Arnd Bergmann > > Acked-by: Marco Elver Thanks, Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BCF44C433F5 for ; Mon, 28 Feb 2022 12:30:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=sUnyO2mYAJkLL+EuiEE1T/en0kjXcxPHwFyJNMvlYJk=; b=acwJyhZ9mIji9+ Q/e7k65jPxnLQA35pj2sGrli0SQ7wGgAP6jPCKHjhzepDr9jcAT1/sFyfLwDp+EpMIGebl9jraWTK pEwLsGlJg8vRFk2cU0yPEQ+U5Pkj4hNa37MFSgW4B4v0I8idyDB+lJPvLydzeFykJuiwH9zsD/rVE fKUfBLGohbIRjmcmL7UqZOI9cFO7n9L/vpxkVNOKn5j7DpjtxKO5Thu19Ejc7FEXFWwOtcSvVi1K9 CtSHfLJiiMfwJTJ5P/i4TFgTuT5CCbMlkhY/bzqQOszo+9IydtqKLyEh3lokWgngtArBq3clrXU12 RvvQrdxXFjf+jIKOj1aQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOf96-00CClU-5w; Mon, 28 Feb 2022 12:28:58 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOefP-00C1r5-Is for linux-arm-kernel@lists.infradead.org; Mon, 28 Feb 2022 11:58:17 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 401D061124 for ; Mon, 28 Feb 2022 11:58:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16BA2C340FD for ; Mon, 28 Feb 2022 11:58:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646049493; bh=+wvb9UMyXw53TgaflmlowqbBW5U339MQvEG61L0RkPg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=dKnUYFqwp2nljzB9HyNzLWj4aTyNWXVZA+BytLq5D7XB/wn2bgjZiMOaqskVpLuiD bk1rXCLmdHoF9yjad0YHG+aChMto6BWqkOaSNkASogtC0xwnUDMGmRpKWwbUUHIN9G T2jY86/3NyMp3QaiaqAGDioEuxukYv9eQ1s5RlKdtbtoQzRo06NdJeugzhX7GPJJPU 4H6CnJkW0b+1gc1ha/tl8+JooMzw6m0qyd4IheUg8d+VSgFqd3J4We8CPaaoborU6O 8ENUz+sQQa6Y+L8l2JDIzlj6xsFuwZlKFvfhceBVVAHW1OeYHoq8q01WwDXvR36vjs Kk7LHoUofOmAg== Received: by mail-wr1-f49.google.com with SMTP id r10so15059307wrp.3 for ; Mon, 28 Feb 2022 03:58:13 -0800 (PST) X-Gm-Message-State: AOAM5337gy50Guo2jeIc8WiJRaSNPTAugIXWexA6xSXfx51xnceSeeaz sY3jbrqsGB0clbst/5lposHRhZRcWEZUU1jQ1k0= X-Google-Smtp-Source: ABdhPJwy6iIN+2EltyCCG8tEZNqW13aNO74dzYWDQrDlYbSLva54a7gegIjmFcrq6DWR6/fwUhMsaBFj3vOKpR4gr9Q= X-Received: by 2002:adf:edc3:0:b0:1ec:5f11:5415 with SMTP id v3-20020adfedc3000000b001ec5f115415mr13633412wro.317.1646049491206; Mon, 28 Feb 2022 03:58:11 -0800 (PST) MIME-Version: 1.0 References: <20220228103142.3301082-1-arnd@kernel.org> In-Reply-To: From: Arnd Bergmann Date: Mon, 28 Feb 2022 12:57:55 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] [v2] Kbuild: move to -std=gnu11 To: Marco Elver Cc: Linux Kbuild mailing list , Arnd Bergmann , Linus Torvalds , Masahiro Yamada , llvm@lists.linux.dev, Jonathan Corbet , Federico Vaga , Alex Shi , Hu Haowen , Michal Marek , Nick Desaulniers , "open list:DOCUMENTATION" , Linux Kernel Mailing List , linux-doc-tw-discuss@lists.sourceforge.net, Linux ARM , Intel Graphics , dri-devel , greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev, linux-btrfs , Mark Rutland X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220228_035815_749943_FEC39BCD X-CRM114-Status: GOOD ( 23.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Feb 28, 2022 at 12:47 PM Marco Elver wrote: > On Mon, 28 Feb 2022 at 11:32, Arnd Bergmann wrote: > > > Nathan Chancellor reported an additional -Wdeclaration-after-statement > > warning that appears in a system header on arm, this still needs a > > workaround. > > On the topic of Wdeclaration-after-statement, Clang only respects this > warning with C99 and later starting with Clang 14: > https://github.com/llvm/llvm-project/commit/c65186c89f35#diff-ec770381d76c859f5f572db789175fe44410a72608f58ad5dbb14335ba56eb97R61 > > Until Clang 14, -Wdeclaration-after-statement is ignored by Clang in > newer standards. If this is a big problem, we can probably convince > the Clang stable folks to backport the fixes. However, the build won't > fail, folks might just miss the warning if they don't also test with > GCC. I don't expect this is to be a big issue, as long as the latest clang behaves as expected. There are many warnings that are only produced by one of the two compilers, so this is something we already deal with. I think it's more important to address the extra warning that Nathan reported, where clang now complains about the intermingled declaration in a system header when previously neither gcc nor clang noticed this. > > The differences between gnu99, gnu11, gnu1x and gnu17 are fairly > > minimal and mainly impact warnings at the -Wpedantic level that the > > kernel never enables. Between these, gnu11 is the newest version > > that is supported by all supported compiler versions, though it is > > only the default on gcc-5, while all other supported versions of > > gcc or clang default to gnu1x/gnu17. > > > > Link: https://lore.kernel.org/lkml/CAHk-=wiyCH7xeHcmiFJ-YgXUy2Jaj7pnkdKpcovt8fYbVFW3TA@mail.gmail.com/ > > Link: https://github.com/ClangBuiltLinux/linux/issues/1603 > > Suggested-by: Linus Torvalds > > Cc: Masahiro Yamada > > Cc: linux-kbuild@vger.kernel.org > > Cc: llvm@lists.linux.dev > > Signed-off-by: Arnd Bergmann > > Acked-by: Marco Elver Thanks, Arnd _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 26B36C433FE for ; Mon, 28 Feb 2022 14:27:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8BCE810E846; Mon, 28 Feb 2022 14:27:05 +0000 (UTC) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9BCC010E626; Mon, 28 Feb 2022 11:58:16 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4B9CEB81109; Mon, 28 Feb 2022 11:58:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08F68C340FA; Mon, 28 Feb 2022 11:58:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646049493; bh=+wvb9UMyXw53TgaflmlowqbBW5U339MQvEG61L0RkPg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=dKnUYFqwp2nljzB9HyNzLWj4aTyNWXVZA+BytLq5D7XB/wn2bgjZiMOaqskVpLuiD bk1rXCLmdHoF9yjad0YHG+aChMto6BWqkOaSNkASogtC0xwnUDMGmRpKWwbUUHIN9G T2jY86/3NyMp3QaiaqAGDioEuxukYv9eQ1s5RlKdtbtoQzRo06NdJeugzhX7GPJJPU 4H6CnJkW0b+1gc1ha/tl8+JooMzw6m0qyd4IheUg8d+VSgFqd3J4We8CPaaoborU6O 8ENUz+sQQa6Y+L8l2JDIzlj6xsFuwZlKFvfhceBVVAHW1OeYHoq8q01WwDXvR36vjs Kk7LHoUofOmAg== Received: by mail-wr1-f49.google.com with SMTP id s13so15050295wrb.6; Mon, 28 Feb 2022 03:58:12 -0800 (PST) X-Gm-Message-State: AOAM531jD02q3w3cBPWV0YFg3nsFDpQcNWuo1+qEmaZ7+eW3cWSf0qbJ 0fnSw0blknB8mlu7NdwVpf9E//HX7pUEaIVnptI= X-Google-Smtp-Source: ABdhPJwy6iIN+2EltyCCG8tEZNqW13aNO74dzYWDQrDlYbSLva54a7gegIjmFcrq6DWR6/fwUhMsaBFj3vOKpR4gr9Q= X-Received: by 2002:adf:edc3:0:b0:1ec:5f11:5415 with SMTP id v3-20020adfedc3000000b001ec5f115415mr13633412wro.317.1646049491206; Mon, 28 Feb 2022 03:58:11 -0800 (PST) MIME-Version: 1.0 References: <20220228103142.3301082-1-arnd@kernel.org> In-Reply-To: From: Arnd Bergmann Date: Mon, 28 Feb 2022 12:57:55 +0100 X-Gmail-Original-Message-ID: Message-ID: To: Marco Elver Content-Type: text/plain; charset="UTF-8" X-Mailman-Approved-At: Mon, 28 Feb 2022 14:26:05 +0000 Subject: Re: [Intel-gfx] [PATCH] [v2] Kbuild: move to -std=gnu11 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux ARM , Mark Rutland , Michal Marek , "open list:DOCUMENTATION" , Arnd Bergmann , Jonathan Corbet , linux-staging@lists.linux.dev, Masahiro Yamada , llvm@lists.linux.dev, Nick Desaulniers , Linux Kernel Mailing List , dri-devel , greybus-dev@lists.linaro.org, Alex Shi , Federico Vaga , Hu Haowen , Intel Graphics , linux-btrfs , Linus Torvalds , linux-doc-tw-discuss@lists.sourceforge.net, Linux Kbuild mailing list Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Mon, Feb 28, 2022 at 12:47 PM Marco Elver wrote: > On Mon, 28 Feb 2022 at 11:32, Arnd Bergmann wrote: > > > Nathan Chancellor reported an additional -Wdeclaration-after-statement > > warning that appears in a system header on arm, this still needs a > > workaround. > > On the topic of Wdeclaration-after-statement, Clang only respects this > warning with C99 and later starting with Clang 14: > https://github.com/llvm/llvm-project/commit/c65186c89f35#diff-ec770381d76c859f5f572db789175fe44410a72608f58ad5dbb14335ba56eb97R61 > > Until Clang 14, -Wdeclaration-after-statement is ignored by Clang in > newer standards. If this is a big problem, we can probably convince > the Clang stable folks to backport the fixes. However, the build won't > fail, folks might just miss the warning if they don't also test with > GCC. I don't expect this is to be a big issue, as long as the latest clang behaves as expected. There are many warnings that are only produced by one of the two compilers, so this is something we already deal with. I think it's more important to address the extra warning that Nathan reported, where clang now complains about the intermingled declaration in a system header when previously neither gcc nor clang noticed this. > > The differences between gnu99, gnu11, gnu1x and gnu17 are fairly > > minimal and mainly impact warnings at the -Wpedantic level that the > > kernel never enables. Between these, gnu11 is the newest version > > that is supported by all supported compiler versions, though it is > > only the default on gcc-5, while all other supported versions of > > gcc or clang default to gnu1x/gnu17. > > > > Link: https://lore.kernel.org/lkml/CAHk-=wiyCH7xeHcmiFJ-YgXUy2Jaj7pnkdKpcovt8fYbVFW3TA@mail.gmail.com/ > > Link: https://github.com/ClangBuiltLinux/linux/issues/1603 > > Suggested-by: Linus Torvalds > > Cc: Masahiro Yamada > > Cc: linux-kbuild@vger.kernel.org > > Cc: llvm@lists.linux.dev > > Signed-off-by: Arnd Bergmann > > Acked-by: Marco Elver Thanks, Arnd