On Fri, Jun 09, 2017 at 11:29:06AM +0200, Martin Liška wrote:
> Having that inlined would be great, however we'll need to put it to tree.h
> and thus we have to include "options.h" before tree.h in multiple source 
> files.

Doesn't that mean that tree.h is not the right header to put this into?
It has nothing to do with the stuff normally in tree.h.
We don't have a common sanitizer header, just asan.h (which already has
similar partially inline checks), ubsan.h and tsan.h, but perhaps putting it
into one of those would be certainly better than tree.h.

> > If there is a previous attribute already, can't you modify it in
> > place?  If not, as it could be perhaps shared? with other functions
> > somehow, at least you should avoid adding a new attribute if
> > (old_value | flags) == old_value.
> 
> Yep, we should definitely share, I'll add test-case for that.

I was worried about stuff like templates, where a template has one
no_sanitize attribute and the implied "no sanitize flags", and then
you instantiate it or specialize it with extra attributes.
Are you sure it can't be ever shared between multiple functions?

        Jakub

Reply via email to