mbox series

[GIT,PULL] Kbuild -std=gnu11 updates for v5.17-rc1

Message ID CAK7LNAQ2HET1QHG17m1vdCGMoRm6Lj=sAe+cj2Via_LHx3xBPg@mail.gmail.com (mailing list archive)
State New, archived
Headers show
Series [GIT,PULL] Kbuild -std=gnu11 updates for v5.17-rc1 | expand

Pull-request

git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git kbuild-gnu11-v5.18

Message

Masahiro Yamada March 25, 2022, 2:37 a.m. UTC
Hi Linus,

This is a small patch set for -std=gnu11 migration.
As you requested, I separated this out.
I will send the second pull request later for the rest
of kbuild updates.

Thank you.





The following changes since commit 754e0b0e35608ed5206d6a67a791563c631cec07:

  Linux 5.17-rc4 (2022-02-13 12:13:30 -0800)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git
kbuild-gnu11-v5.18

for you to fetch changes up to 1e24078113ae69c741cb1b03375a9f1490db7308:

  Kbuild: use -std=gnu11 for KBUILD_USERCFLAGS (2022-03-13 17:31:44 +0900)

----------------------------------------------------------------
Kbuild -std=gnu11 updates for v5.18

Linus pointed out the benefits of C99 some years ago, especially variable
declarations in loops [1]. At that time, we were not ready for the
migration due to old compilers.

Recently, Jakob Koschel reported a bug in list_for_each_entry(), which
leaks the invalid pointer out of the loop [2]. In the discussion, we
agreed that the time had come. Now that GCC 5.1 is the minimum compiler
version, there is nothing to prevent us from going to -std=gnu99, or even
straight to -std=gnu11.

Discussions for a better list iterator implementation are ongoing, but
this patch set must land first.

[1] https://lore.kernel.org/all/CAHk-=wgr12JkKmRd21qh-se-_Gs69kbPgR9x4C+Es-yJV2GLkA@mail.gmail.com/
[2] https://lore.kernel.org/lkml/86C4CE7D-6D93-456B-AA82-F8ADEACA40B7@gmail.com/

----------------------------------------------------------------
Arnd Bergmann (3):
      Kbuild: add -Wno-shift-negative-value where -Wextra is used
      Kbuild: move to -std=gnu11
      Kbuild: use -std=gnu11 for KBUILD_USERCFLAGS

Mark Rutland (1):
      Kbuild: use -Wdeclaration-after-statement

 Documentation/process/programming-language.rst                    | 6 +++---
 Documentation/translations/it_IT/process/programming-language.rst | 4 ++--
 Documentation/translations/zh_CN/process/programming-language.rst | 3 +--
 Documentation/translations/zh_TW/process/programming-language.rst | 3 +--
 Makefile                                                          | 7 ++++---
 arch/arm64/kernel/vdso32/Makefile                                 | 3 ++-
 drivers/gpu/drm/i915/Makefile                                     | 1 +
 drivers/staging/greybus/tools/Makefile                            | 3 ++-
 fs/btrfs/Makefile                                                 | 1 +
 scripts/Makefile.extrawarn                                        | 1 +
 scripts/mod/modpost.c                                             | 4 +++-
 11 files changed, 21 insertions(+), 15 deletions(-)

Comments

Masahiro Yamada March 25, 2022, 4:41 a.m. UTC | #1
Sorry, the email subject,

    Kbuild -std=gnu11 updates for v5.17-rc1

contains a typo.
It should be for "v5.18-rc1" , of course.





On Fri, Mar 25, 2022 at 11:37 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> Hi Linus,
>
> This is a small patch set for -std=gnu11 migration.
> As you requested, I separated this out.
> I will send the second pull request later for the rest
> of kbuild updates.
>
> Thank you.
>
>
>
>
>
> The following changes since commit 754e0b0e35608ed5206d6a67a791563c631cec07:
>
>   Linux 5.17-rc4 (2022-02-13 12:13:30 -0800)
>
> are available in the Git repository at:
>
>   git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git
> kbuild-gnu11-v5.18
>
> for you to fetch changes up to 1e24078113ae69c741cb1b03375a9f1490db7308:
>
>   Kbuild: use -std=gnu11 for KBUILD_USERCFLAGS (2022-03-13 17:31:44 +0900)
>
> ----------------------------------------------------------------
> Kbuild -std=gnu11 updates for v5.18
>
> Linus pointed out the benefits of C99 some years ago, especially variable
> declarations in loops [1]. At that time, we were not ready for the
> migration due to old compilers.
>
> Recently, Jakob Koschel reported a bug in list_for_each_entry(), which
> leaks the invalid pointer out of the loop [2]. In the discussion, we
> agreed that the time had come. Now that GCC 5.1 is the minimum compiler
> version, there is nothing to prevent us from going to -std=gnu99, or even
> straight to -std=gnu11.
>
> Discussions for a better list iterator implementation are ongoing, but
> this patch set must land first.
>
> [1] https://lore.kernel.org/all/CAHk-=wgr12JkKmRd21qh-se-_Gs69kbPgR9x4C+Es-yJV2GLkA@mail.gmail.com/
> [2] https://lore.kernel.org/lkml/86C4CE7D-6D93-456B-AA82-F8ADEACA40B7@gmail.com/
>
> ----------------------------------------------------------------
> Arnd Bergmann (3):
>       Kbuild: add -Wno-shift-negative-value where -Wextra is used
>       Kbuild: move to -std=gnu11
>       Kbuild: use -std=gnu11 for KBUILD_USERCFLAGS
>
> Mark Rutland (1):
>       Kbuild: use -Wdeclaration-after-statement
>
>  Documentation/process/programming-language.rst                    | 6 +++---
>  Documentation/translations/it_IT/process/programming-language.rst | 4 ++--
>  Documentation/translations/zh_CN/process/programming-language.rst | 3 +--
>  Documentation/translations/zh_TW/process/programming-language.rst | 3 +--
>  Makefile                                                          | 7 ++++---
>  arch/arm64/kernel/vdso32/Makefile                                 | 3 ++-
>  drivers/gpu/drm/i915/Makefile                                     | 1 +
>  drivers/staging/greybus/tools/Makefile                            | 3 ++-
>  fs/btrfs/Makefile                                                 | 1 +
>  scripts/Makefile.extrawarn                                        | 1 +
>  scripts/mod/modpost.c                                             | 4 +++-
>  11 files changed, 21 insertions(+), 15 deletions(-)
>
>
> --
> Best Regards
> Masahiro Yamada
pr-tracker-bot@kernel.org March 25, 2022, 7:06 p.m. UTC | #2
The pull request you sent on Fri, 25 Mar 2022 11:37:37 +0900:

> git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git kbuild-gnu11-v5.18

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/50560ce6a0bdab2fc37384c52aa02c7043909d2c

Thank you!