[cfe-dev] making -ftrivial-auto-var-init=zero a first-class option

Kees Cook via cfe-dev cfe-dev at lists.llvm.org
Wed Apr 22 10:44:03 PDT 2020


On Wed, Apr 22, 2020 at 09:53:44AM -0700, Philip Reames wrote:
> 
> On 4/21/20 4:59 PM, Richard Smith wrote:
> > On Tue, 21 Apr 2020 at 16:49, Philip Reames via cfe-dev
> > <cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>> wrote:
> > 
> >     On 4/21/20 3:11 PM, Richard Smith via cfe-dev wrote:
> > 
> >     Richard, just to check here, it sounds to me like you're raising
> >     more a point of specification then of implementation right?  That
> >     is, you're not stating that the actual implementation must
> >     sometimes trap (when producing a zero wouldn't), but that the
> >     specification of the flags and docs must leave the possibility
> >     there of?
> > 
> > Well, I think it's not sufficient to merely say that we might do
> > something like trap, if our intent is that we never will. We would need
> > to reasonably agree that (for example) if someone came forward with a
> > patch that actually implemented said trapping behavior and didn't
> > introduce any significant code size or performance impact, that we would
> > consider such a change to be a quality of implementation improvement.
> > But I don't think we need anyone to have actually committed themselves
> > to producing such a patch, or any timeline or expectation of when (or
> > indeed whether) it would be done. Sorry if this is splitting a hair, but
> > I think it's an important hair to split.
> Hair successfully split.  I agree it is a key distinction.

What would this look like on the command line side of things? Would this
be a new mode, like -ftrivial-auto-var-init=trap, but initially "trap"
would just do the same as "zero", until it was improved to actually trap?

-- 
Kees Cook


More information about the cfe-dev mailing list