linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: Marco Elver <elver@google.com>
Cc: Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Masahiro Yamada <masahiroy@kernel.org>,
	llvm@lists.linux.dev, Jonathan Corbet <corbet@lwn.net>,
	Federico Vaga <federico.vaga@vaga.pv.it>,
	Alex Shi <alexs@kernel.org>, Hu Haowen <src.res@email.cn>,
	Michal Marek <michal.lkml@markovi.net>,
	Nick Desaulniers <ndesaulniers@google.com>,
	"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-doc-tw-discuss@lists.sourceforge.net,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Intel Graphics <intel-gfx@lists.freedesktop.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev,
	linux-btrfs <linux-btrfs@vger.kernel.org>,
	Mark Rutland <mark.rutland@arm.com>
Subject: Re: [PATCH] [v2] Kbuild: move to -std=gnu11
Date: Mon, 28 Feb 2022 12:57:55 +0100	[thread overview]
Message-ID: <CAK8P3a3cRa1piP2BSmN2dTW4QErhSP7AMO9xqAm=_FFYprAkOA@mail.gmail.com> (raw)
In-Reply-To: <CANpmjNP6VE9G8Yng4W7Mayk-0QsqUtAXkrMUSvL5pAP5DpXSmA@mail.gmail.com>

On Mon, Feb 28, 2022 at 12:47 PM Marco Elver <elver@google.com> wrote:
> On Mon, 28 Feb 2022 at 11:32, Arnd Bergmann <arnd@kernel.org> 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 <torvalds@linux-foundation.org>
> > Cc: Masahiro Yamada <masahiroy@kernel.org>
> > Cc: linux-kbuild@vger.kernel.org
> > Cc: llvm@lists.linux.dev
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> Acked-by: Marco Elver <elver@google.com>

Thanks,

         Arnd

  reply	other threads:[~2022-02-28 11:58 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-28 10:27 [PATCH] [v2] Kbuild: move to -std=gnu11 Arnd Bergmann
2022-02-28 10:50 ` Greg KH
2022-02-28 11:25 ` Mark Rutland
2022-02-28 11:37   ` Arnd Bergmann
2022-02-28 18:40     ` Linus Torvalds
2022-02-28 17:07   ` Masahiro Yamada
2022-02-28 11:47 ` Marco Elver
2022-02-28 11:57   ` Arnd Bergmann [this message]
2022-02-28 16:56     ` Nathan Chancellor
2022-02-28 12:36 ` Jani Nikula
2022-02-28 13:01   ` Arnd Bergmann
2022-02-28 13:19     ` David Sterba
2022-02-28 12:48 ` Alex Shi
2022-02-28 12:56 ` David Sterba
2022-02-28 17:02 ` Masahiro Yamada
2022-02-28 18:24   ` Arnd Bergmann
2022-02-28 21:03 ` Nick Desaulniers
2022-02-28 21:41   ` Fangrui Song
2022-03-01 14:45     ` Arnd Bergmann
2022-03-01 10:43 ` Miguel Ojeda
2022-03-01 14:44   ` Arnd Bergmann
2022-05-16 13:10 ` Guenter Roeck
2022-05-16 13:31   ` [greybus-dev] " Greg KH
2022-05-16 14:19     ` Guenter Roeck
2022-05-18  7:46       ` Arnd Bergmann
2022-05-18 14:07         ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAK8P3a3cRa1piP2BSmN2dTW4QErhSP7AMO9xqAm=_FFYprAkOA@mail.gmail.com' \
    --to=arnd@kernel.org \
    --cc=alexs@kernel.org \
    --cc=arnd@arndb.de \
    --cc=corbet@lwn.net \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=elver@google.com \
    --cc=federico.vaga@vaga.pv.it \
    --cc=greybus-dev@lists.linaro.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-doc-tw-discuss@lists.sourceforge.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=llvm@lists.linux.dev \
    --cc=mark.rutland@arm.com \
    --cc=masahiroy@kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=ndesaulniers@google.com \
    --cc=src.res@email.cn \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).