[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YoJSF8T5K9pPx3Ap@kroah.com>
Date: Mon, 16 May 2022 15:31:03 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: Guenter Roeck <linux@...ck-us.net>
Cc: Arnd Bergmann <arnd@...nel.org>, linux-kbuild@...r.kernel.org,
Arnd Bergmann <arnd@...db.de>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Masahiro Yamada <masahiroy@...nel.org>, llvm@...ts.linux.dev,
Jonathan Corbet <corbet@....net>,
Federico Vaga <federico.vaga@...a.pv.it>,
Alex Shi <alexs@...nel.org>, Hu Haowen <src.res@...il.cn>,
Michal Marek <michal.lkml@...kovi.net>,
Nick Desaulniers <ndesaulniers@...gle.com>,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-doc-tw-discuss@...ts.sourceforge.net,
linux-arm-kernel@...ts.infradead.org,
intel-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
greybus-dev@...ts.linaro.org, linux-staging@...ts.linux.dev,
linux-btrfs@...r.kernel.org
Subject: Re: [greybus-dev] Re: [PATCH] [v2] Kbuild: move to -std=gnu11
On Mon, May 16, 2022 at 06:10:23AM -0700, Guenter Roeck wrote:
> On Mon, Feb 28, 2022 at 11:27:43AM +0100, Arnd Bergmann wrote:
> > From: Arnd Bergmann <arnd@...db.de>
> >
> > 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 standards
> > introduce many other features, most of these are already available in
> > gnu89 as GNU extensions as well.
>
> The downside is that backporting affected patches to older kernel branches
> now fails with error messages such as
>
> mm/kfence/core.c: In function ‘kfence_init_pool’:
> mm/kfence/core.c:595:2: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
>
> Just something to keep in mind when writing patches.
I just ran across this very issue on this commit. It's an easy fixup
for 5.17.y to make this work, so I did that in my tree. If this gets to
be too much, we might need to reconsider adding c11 to older stable
kernels.
thanks,
greg k-h
Powered by blists - more mailing lists