Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2754771pxm; Mon, 28 Feb 2022 05:34:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJzJkEIa1LFTOiHgZ4Hf9ADpysIIfTL+TTZKYmk6LDDR2iwWFVDpEPfZ2Cd5VNeDM65XZLL3 X-Received: by 2002:a17:902:8f82:b0:151:5d30:a019 with SMTP id z2-20020a1709028f8200b001515d30a019mr7623032plo.145.1646055251699; Mon, 28 Feb 2022 05:34:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646055251; cv=none; d=google.com; s=arc-20160816; b=w/V/2WS6qRhb2Z3cE/rzSWvZmXmltTK8y294TNpC4JDrYTCl/+ekhkrGr5Tg9VGdQw 1XXECpRwnrh2F1H8XfqwG870b+XCgsFdcwGTJeQKktbIThaebefRHazCMQk90rkbMxDk 2/QRojz8uOya0YwLFLHHJjEL6pC2bkogjpHtdq3LYO+DJjnwkL1sPUIcflsSjbi/sJFC h0CQhUrpZAwW1vhppTckbc39tKhuywag/CaH1ivRUZ4vjWu2jSLiCjD/xNNk9VaU4+Bw w6hPSF9X/V2oPNYOGMJ8eb/lQ8zHMvM00T7d2KhLQnzrGO56hnEaiVDBkwJ5O1Q1gmb5 1Qvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=AP0PgNepdnxsOpz/9ZEeiz4P6tZwSjtnIOow+xt1Bhs=; b=o/SAMJ/xjqoi4WLk4KtrUYYwu9RZHPvQUgCVH8gHJkY1aJzfESad8DprdJM+0ld1Ny KbSTfeBeo+yR/KUMwTzy2OGRrwpfOvTqxC6gq6/2B0mUs7ShXvrnHutK65fJengdM1qq W+ndm57+HPSkPobQ7C7KaEzMmW/XSc/xStncMYq15wfaT687iKHL2yfiwO3km3jjF3vW K4BDiswQx759reX/mmnMOq+NcT5UBk5ZtrImnrrBb7QSy2WvGiuboxgfQdBFhfzZ46Io W1lRsLmFUADLn9RB0H/6VjxokCGqj5HaZbA18sEvwvkQAiwkazZz2dPCwiFQ9GSRxIS5 d0iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=J15huMm9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q21-20020a170903205500b0014ad7140365si8369021pla.346.2022.02.28.05.33.54; Mon, 28 Feb 2022 05:34:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=J15huMm9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235981AbiB1LtA (ORCPT + 99 others); Mon, 28 Feb 2022 06:49:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233945AbiB1Ls7 (ORCPT ); Mon, 28 Feb 2022 06:48:59 -0500 Received: from mail-yw1-x112c.google.com (mail-yw1-x112c.google.com [IPv6:2607:f8b0:4864:20::112c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6FAA5939A for ; Mon, 28 Feb 2022 03:48:18 -0800 (PST) Received: by mail-yw1-x112c.google.com with SMTP id 00721157ae682-2d66f95f1d1so105185997b3.0 for ; Mon, 28 Feb 2022 03:48:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=AP0PgNepdnxsOpz/9ZEeiz4P6tZwSjtnIOow+xt1Bhs=; b=J15huMm9W/rsHw7l7UxwubQm3myLmtLN+/oxVy/pt1DW7c92Mq1yCwuAN3Nr2eKnbI q8btDsNov4R7ykysxpbds/3h6ptMJrWrOfYlC7NuqyBq/6Ivytd42FC7qsNwk1w5ZCPx ESIWyZEYMJuS7HB46Ga0xM26C8utsWKu0yZbGfIeJEQKhoQgjwwCwUO9i6Ou/GJEuves SXEVpKTxjZ7JHbxMU9QdmXqy5m8JRZmq7uVdVhlrk7/Vl3/02U60prldKXhUpH+vieH5 IUJQrTA2DD5WiTQlMvMZOHbrH+ZJ66cSxhiXK2xGxC1UuW31CsBkTpRQMSNt8XKUYi5Z LlOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=AP0PgNepdnxsOpz/9ZEeiz4P6tZwSjtnIOow+xt1Bhs=; b=Rp995/p6gUXcGLl+IZ4LEnX+d0KXs2uxRNWpWlZmcSRXkME+RYvY1UGT6E8E0hLIJP Lck+C8NvT9CEe1cqkqcWe+DMYvTNf4viFQlulJgb5MeQiEDH89A2uf+v7dmT46BsHzAn OBqiVOW01ioE7IKg+PpmbxLzHwEz1n2jUZ5QRHhPDnSc+oxuiNE02NcpxfT33dGt9+d9 ExrogHX1Cd01PhRkXiEt93y5CDMUD3CHDsNiFInJGRj2mLSAAdv0+lMpstJDDrCjahW7 RMGRiEC8Y3DnngEi0GPKJ1g2PMXMwDPQRrmBSsVuY+26Fg2SmY9Wb/826RaMo3TOIVEP bngg== X-Gm-Message-State: AOAM532ebb5Zk9E6ktUY5ScB0rNHutG9p6PkY2Ndgp/jLuhqrT5OLXMM d1yKhDlcKUOEfzotCnbQx+hhfsnDVhbwPQ/AeqAvRQ== X-Received: by 2002:a81:743:0:b0:2ca:287c:6ca2 with SMTP id 64-20020a810743000000b002ca287c6ca2mr18866401ywh.327.1646048897841; Mon, 28 Feb 2022 03:48:17 -0800 (PST) MIME-Version: 1.0 References: <20220228103142.3301082-1-arnd@kernel.org> In-Reply-To: <20220228103142.3301082-1-arnd@kernel.org> From: Marco Elver Date: Mon, 28 Feb 2022 12:47:41 +0100 Message-ID: Subject: Re: [PATCH] [v2] Kbuild: move to -std=gnu11 To: Arnd Bergmann Cc: linux-kbuild@vger.kernel.org, Arnd Bergmann , Linus Torvalds , Masahiro Yamada , llvm@lists.linux.dev, Jonathan Corbet , Federico Vaga , Alex Shi , Hu Haowen , Michal Marek , Nick Desaulniers , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, linux-arm-kernel@lists.infradead.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev, linux-btrfs@vger.kernel.org, Mark Rutland Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-18.1 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 28 Feb 2022 at 11:32, Arnd Bergmann wrote: > > From: Arnd Bergmann > > During a patch discussion, Linus brought up the option of changing > the C standard version from gnu89 to gnu99, which allows using variable > declaration inside of a for() loop. While the C99, C11 and later standard= s > introduce many other features, most of these are already available in > gnu89 as GNU extensions as well. > > An earlier attempt to do this when gcc-5 started defaulting to > -std=3Dgnu11 failed because at the time that caused warnings about > designated initializers with older compilers. Now that gcc-5.1 is the > minimum compiler version used for building kernels, that is no longer a > concern. Similarly, the behavior of 'inline' functions changes between > gnu89 and gnu11, but this was taken care of by defining 'inline' to > include __attribute__((gnu_inline)) in order to allow building with > clang a while ago. > > One minor issue that remains is an added gcc warning for shifts of > negative integers when building with -Werror, which happens with the > 'make W=3D1' option, as well as for three drivers in the kernel that alwa= ys > enable -Werror, but it was only observed with the i915 driver so far. > To be on the safe side, add -Wno-shift-negative-value to any -Wextra > in a Makefile. > > 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-ec770381d76c8= 59f5f572db789175fe44410a72608f58ad5dbb14335ba56eb97R61 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. > 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-=3DwiyCH7xeHcmiFJ-YgXUy2Jaj7pnkdK= pcovt8fYbVFW3TA@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, -- Marco > --- > [v2] > - added -std=3Dgnu11 back, rather than just relying on the default > - minor changes to changelog text > --- > Documentation/process/programming-language.rst | 4 ++-- > .../translations/it_IT/process/programming-language.rst | 4 ++-- > .../translations/zh_CN/process/programming-language.rst | 4 ++-- > .../translations/zh_TW/process/programming-language.rst | 4 ++-- > Makefile | 6 +++--- > arch/arm64/kernel/vdso32/Makefile | 2 +- > drivers/gpu/drm/i915/Makefile | 1 + > drivers/staging/greybus/tools/Makefile | 3 ++- > fs/btrfs/Makefile | 1 + > scripts/Makefile.extrawarn | 1 + > 10 files changed, 17 insertions(+), 13 deletions(-) > > diff --git a/Documentation/process/programming-language.rst b/Documentati= on/process/programming-language.rst > index ec474a70a02f..894f2a6eb9db 100644 > --- a/Documentation/process/programming-language.rst > +++ b/Documentation/process/programming-language.rst > @@ -5,8 +5,8 @@ Programming Language > > The kernel is written in the C programming language [c-language]_. > More precisely, the kernel is typically compiled with ``gcc`` [gcc]_ > -under ``-std=3Dgnu89`` [gcc-c-dialect-options]_: the GNU dialect of ISO = C90 > -(including some C99 features). ``clang`` [clang]_ is also supported, see > +under ``-std=3Dgnu11`` [gcc-c-dialect-options]_: the GNU dialect of ISO = C11 > +(including some C17 features). ``clang`` [clang]_ is also supported, see > docs on :ref:`Building Linux with Clang/LLVM `. > > This dialect contains many extensions to the language [gnu-extensions]_, > diff --git a/Documentation/translations/it_IT/process/programming-languag= e.rst b/Documentation/translations/it_IT/process/programming-language.rst > index 41db2598ce11..aa21097737ae 100644 > --- a/Documentation/translations/it_IT/process/programming-language.rst > +++ b/Documentation/translations/it_IT/process/programming-language.rst > @@ -10,8 +10,8 @@ Linguaggio di programmazione > > Il kernel =C3=A8 scritto nel linguaggio di programmazione C [it-c-langua= ge]_. > Pi=C3=B9 precisamente, il kernel viene compilato con ``gcc`` [it-gcc]_ u= sando > -l'opzione ``-std=3Dgnu89`` [it-gcc-c-dialect-options]_: il dialetto GNU > -dello standard ISO C90 (con l'aggiunta di alcune funzionalit=C3=A0 da C9= 9). > +l'opzione ``-std=3Dgnu11`` [it-gcc-c-dialect-options]_: il dialetto GNU > +dello standard ISO C11 (con l'aggiunta di alcune funzionalit=C3=A0 da C1= 7). > Linux supporta anche ``clang`` [it-clang]_, leggete la documentazione > :ref:`Building Linux with Clang/LLVM `. > > diff --git a/Documentation/translations/zh_CN/process/programming-languag= e.rst b/Documentation/translations/zh_CN/process/programming-language.rst > index 2a47a1d2ec20..58d2b3bd2d85 100644 > --- a/Documentation/translations/zh_CN/process/programming-language.rst > +++ b/Documentation/translations/zh_CN/process/programming-language.rst > @@ -9,8 +9,8 @@ > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > =E5=86=85=E6=A0=B8=E6=98=AF=E7=94=A8C=E8=AF=AD=E8=A8=80 :ref:`c-language= ` =E7=BC=96=E5=86=99=E7=9A=84=E3=80=82=E6=9B=B4=E5=87=86=E7= =A1=AE=E5=9C=B0=E8=AF=B4=EF=BC=8C=E5=86=85=E6=A0=B8=E9=80=9A=E5=B8=B8=E6=98= =AF=E7=94=A8 :ref:`gcc ` > -=E5=9C=A8 ``-std=3Dgnu89`` :ref:`gcc-c-dialect-options ` =E4=B8=8B=E7=BC=96=E8=AF=91=E7=9A=84=EF=BC=9AISO C90=E7=9A=84 GN= U =E6=96=B9=E8=A8=80=EF=BC=88 > -=E5=8C=85=E6=8B=AC=E4=B8=80=E4=BA=9BC99=E7=89=B9=E6=80=A7=EF=BC=89 > +=E5=9C=A8 ``-std=3Dgnu11`` :ref:`gcc-c-dialect-options ` =E4=B8=8B=E7=BC=96=E8=AF=91=E7=9A=84=EF=BC=9AISO C11=E7=9A=84 GN= U =E6=96=B9=E8=A8=80=EF=BC=88 > +=E5=8C=85=E6=8B=AC=E4=B8=80=E4=BA=9BC17=E7=89=B9=E6=80=A7=EF=BC=89 > > =E8=BF=99=E7=A7=8D=E6=96=B9=E8=A8=80=E5=8C=85=E5=90=AB=E5=AF=B9=E8=AF=AD= =E8=A8=80 :ref:`gnu-extensions ` =E7=9A=84=E8=AE=B8=E5= =A4=9A=E6=89=A9=E5=B1=95=EF=BC=8C=E5=BD=93=E7=84=B6=EF=BC=8C=E5=AE=83=E4=BB= =AC=E8=AE=B8=E5=A4=9A=E9=83=BD=E5=9C=A8=E5=86=85=E6=A0=B8=E4=B8=AD=E4=BD=BF= =E7=94=A8=E3=80=82 > > diff --git a/Documentation/translations/zh_TW/process/programming-languag= e.rst b/Documentation/translations/zh_TW/process/programming-language.rst > index 54e3699eadf8..235de05f7e2c 100644 > --- a/Documentation/translations/zh_TW/process/programming-language.rst > +++ b/Documentation/translations/zh_TW/process/programming-language.rst > @@ -12,8 +12,8 @@ > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > =E5=85=A7=E6=A0=B8=E6=98=AF=E7=94=A8C=E8=AA=9E=E8=A8=80 :ref:`c-language= ` =E7=B7=A8=E5=AF=AB=E7=9A=84=E3=80=82=E6=9B=B4=E6=BA=96=E7= =A2=BA=E5=9C=B0=E8=AA=AA=EF=BC=8C=E5=85=A7=E6=A0=B8=E9=80=9A=E5=B8=B8=E6=98= =AF=E7=94=A8 :ref:`gcc ` > -=E5=9C=A8 ``-std=3Dgnu89`` :ref:`gcc-c-dialect-options ` =E4=B8=8B=E7=B7=A8=E8=AD=AF=E7=9A=84=EF=BC=9AISO C90=E7=9A=84 GN= U =E6=96=B9=E8=A8=80=EF=BC=88 > -=E5=8C=85=E6=8B=AC=E4=B8=80=E4=BA=9BC99=E7=89=B9=E6=80=A7=EF=BC=89 > +=E5=9C=A8 ``-std=3Dgnu11`` :ref:`gcc-c-dialect-options ` =E4=B8=8B=E7=B7=A8=E8=AD=AF=E7=9A=84=EF=BC=9AISO C11=E7=9A=84 GN= U =E6=96=B9=E8=A8=80=EF=BC=88 > +=E5=8C=85=E6=8B=AC=E4=B8=80=E4=BA=9BC17=E7=89=B9=E6=80=A7=EF=BC=89 > > =E9=80=99=E7=A8=AE=E6=96=B9=E8=A8=80=E5=8C=85=E5=90=AB=E5=B0=8D=E8=AA=9E= =E8=A8=80 :ref:`gnu-extensions ` =E7=9A=84=E8=A8=B1=E5= =A4=9A=E6=93=B4=E5=B1=95=EF=BC=8C=E7=95=B6=E7=84=B6=EF=BC=8C=E5=AE=83=E5=80= =91=E8=A8=B1=E5=A4=9A=E9=83=BD=E5=9C=A8=E5=85=A7=E6=A0=B8=E4=B8=AD=E4=BD=BF= =E7=94=A8=E3=80=82 > > diff --git a/Makefile b/Makefile > index 289ce2be8032..66496eaeb9ec 100644 > --- a/Makefile > +++ b/Makefile > @@ -432,7 +432,7 @@ HOSTCXX =3D g++ > endif > > export KBUILD_USERCFLAGS :=3D -Wall -Wmissing-prototypes -Wstrict-protot= ypes \ > - -O2 -fomit-frame-pointer -std=3Dgnu89 > + -O2 -fomit-frame-pointer -std=3Dgnu11 > export KBUILD_USERLDFLAGS :=3D > > KBUILD_HOSTCFLAGS :=3D $(KBUILD_USERCFLAGS) $(HOST_LFS_CFLAGS) $(HOSTC= FLAGS) > @@ -515,7 +515,7 @@ KBUILD_CFLAGS :=3D -Wall -Wundef -Werror=3Dstrict-p= rototypes -Wno-trigraphs \ > -fno-strict-aliasing -fno-common -fshort-wchar -fno-PI= E \ > -Werror=3Dimplicit-function-declaration -Werror=3Dimpl= icit-int \ > -Werror=3Dreturn-type -Wno-format-security \ > - -std=3Dgnu89 > + -std=3Dgnu11 > KBUILD_CPPFLAGS :=3D -D__KERNEL__ > KBUILD_AFLAGS_KERNEL :=3D > KBUILD_CFLAGS_KERNEL :=3D > @@ -782,7 +782,7 @@ KBUILD_CFLAGS +=3D $(KBUILD_CFLAGS-y) $(CONFIG_CC_IMP= LICIT_FALLTHROUGH) > > ifdef CONFIG_CC_IS_CLANG > KBUILD_CPPFLAGS +=3D -Qunused-arguments > -# The kernel builds with '-std=3Dgnu89' so use of GNU extensions is acce= ptable. > +# The kernel builds with '-std=3Dgnu11' so use of GNU extensions is acce= ptable. > KBUILD_CFLAGS +=3D -Wno-gnu > # CLANG uses a _MergedGlobals as optimization, but this breaks modpost, = as the > # source of a reference will be _MergedGlobals and not on of the whiteli= sted names. > diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32= /Makefile > index 6c01b63ff56d..9378ea055bf2 100644 > --- a/arch/arm64/kernel/vdso32/Makefile > +++ b/arch/arm64/kernel/vdso32/Makefile > @@ -68,7 +68,7 @@ VDSO_CFLAGS +=3D -Wall -Wundef -Wstrict-prototypes -Wno= -trigraphs \ > -fno-strict-aliasing -fno-common \ > -Werror-implicit-function-declaration \ > -Wno-format-security \ > - -std=3Dgnu89 > + -std=3Dgnu11 > VDSO_CFLAGS +=3D -O2 > # Some useful compiler-dependent flags from top-level Makefile > VDSO_CFLAGS +=3D $(call cc32-option,-Wdeclaration-after-statement,) > diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefil= e > index 1b62b9f65196..1618a6e0af4e 100644 > --- a/drivers/gpu/drm/i915/Makefile > +++ b/drivers/gpu/drm/i915/Makefile > @@ -17,6 +17,7 @@ subdir-ccflags-y +=3D -Wno-unused-parameter > subdir-ccflags-y +=3D -Wno-type-limits > subdir-ccflags-y +=3D -Wno-missing-field-initializers > subdir-ccflags-y +=3D -Wno-sign-compare > +subdir-ccflags-y +=3D -Wno-shift-negative-value > subdir-ccflags-y +=3D $(call cc-disable-warning, unused-but-set-variable= ) > subdir-ccflags-y +=3D $(call cc-disable-warning, frame-address) > subdir-ccflags-$(CONFIG_DRM_I915_WERROR) +=3D -Werror > diff --git a/drivers/staging/greybus/tools/Makefile b/drivers/staging/gre= ybus/tools/Makefile > index ad0ae8053b79..a3bbd73171f2 100644 > --- a/drivers/staging/greybus/tools/Makefile > +++ b/drivers/staging/greybus/tools/Makefile > @@ -12,7 +12,8 @@ CFLAGS +=3D -std=3Dgnu99 -Wall -Wextra -g \ > -Wredundant-decls \ > -Wcast-align \ > -Wsign-compare \ > - -Wno-missing-field-initializers > + -Wno-missing-field-initializers \ > + -Wno-shift-negative-value > > CC :=3D $(CROSS_COMPILE)gcc > > diff --git a/fs/btrfs/Makefile b/fs/btrfs/Makefile > index 4188ba3fd8c3..99f9995670ea 100644 > --- a/fs/btrfs/Makefile > +++ b/fs/btrfs/Makefile > @@ -17,6 +17,7 @@ subdir-ccflags-y +=3D $(condflags) > subdir-ccflags-y +=3D -Wno-missing-field-initializers > subdir-ccflags-y +=3D -Wno-sign-compare > subdir-ccflags-y +=3D -Wno-type-limits > +subdir-ccflags-y +=3D -Wno-shift-negative-value > > obj-$(CONFIG_BTRFS_FS) :=3D btrfs.o > > diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn > index 8be892887d71..650d0b8ceec3 100644 > --- a/scripts/Makefile.extrawarn > +++ b/scripts/Makefile.extrawarn > @@ -36,6 +36,7 @@ KBUILD_CFLAGS +=3D $(call cc-option, -Wstringop-truncat= ion) > KBUILD_CFLAGS +=3D -Wno-missing-field-initializers > KBUILD_CFLAGS +=3D -Wno-sign-compare > KBUILD_CFLAGS +=3D -Wno-type-limits > +KBUILD_CFLAGS +=3D -Wno-shift-negative-value > > KBUILD_CPPFLAGS +=3D -DKBUILD_EXTRA_WARN1 > > -- > 2.29.2 > >