[PATCH] Implement no_sanitize attribute.

Peter Collingbourne peter at pcc.me.uk
Thu May 14 15:35:10 PDT 2015


On Thu, May 14, 2015 at 04:49:04PM -0400, Aaron Ballman wrote:
> On Thu, May 14, 2015 at 4:37 PM, Peter Collingbourne <peter at pcc.me.uk> wrote:
> > On Thu, May 14, 2015 at 10:42:50AM -0400, Aaron Ballman wrote:
> >> On Wed, May 13, 2015 at 6:40 PM, Peter Collingbourne <peter at pcc.me.uk> wrote:
> >> > These constructs were added to clang in r237055 and r237056.
> >>
> >> Thank you; I was just slightly too out of date to have them. Having
> >> fetched, I'm back on the same page.
> >>
> >> I don't think a variadic enumeration argument will be worth the effort
> >> given the structure of Sanitizers.def. However, the current approach
> >> is still incorrect. For instance, the attribute will not round-trip a
> >> pretty printing, and it fails to diagnose illogical values that wind
> >> up being ignored.
> >
> > FWIW, this is deliberate. We shouldn't diagnose unknown sanitizers because
> > there ought to be a way to supply a no_sanitize attribute for any particular
> > sanitizer in a way that is backwards compatible with older versions of Clang
> > that do not support the sanitizer.
> 
> I understand the backwards compatibility argument, however, silently
> ignoring attributes is something we generally try to warn on. The
> benefit of having the warning is that it shows you times you
> accidentally have a typo in your warning, which is trivial to
> overlook. Users can turn the warning off if it turns out to be chatty
> for them (I would make a new diagnostic for this, not attempt to reuse
> an old one).

Fair point, done.

Thanks,
-- 
Peter



More information about the cfe-commits mailing list