[PATCH] D64742: Allow using -ftrivial-auto-var-init=zero in C mode without extra flags

Alexander Potapenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 23 08:51:18 PDT 2019


glider added a comment.

In D64742#1717054 <https://reviews.llvm.org/D64742#1717054>, @mehdi_amini wrote:

> In D64742#1606244 <https://reviews.llvm.org/D64742#1606244>, @glider wrote:
>
> > As a data point, Linus Torvalds suggested that we need a similar feature for GCC so that the "kernel C standard" mandates zero-initialization for locals: https://lkml.org/lkml/2019/7/28/206
>
>
> I'm wondering why they never pushed all the way for a `-std=linux-c` flag instead, and produced a documentation with the behavior they want with respect to the base C standard they align on.


Guess this was never necessary, as GCC used to be the only compiler that could build the Linux kernel, and the standard could be defined by a combination of GCC flags.
This is no more the case, but adding a separate "standard" (which may end up being vaguely defined and containing ad-hoc hacks) will require a lot of effort from the three communities (Linux, GCC and LLVM)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64742/new/

https://reviews.llvm.org/D64742





More information about the cfe-commits mailing list