Re: [PATCH 0/6] pull: almost working AddressSanitizer support

Karel Zak
2014-11-13T14:48:49Z

On Wed, Nov 12, 2014 at 08:50:01PM +0000, Sami Kerola wrote:
> +/*
> + * UL_ASAN_BLACKLIST is a macro to tell AddressSanitizer (a compile-time
> + * instrumentation shipped with Clang and GCC) to not instrument the
> + * annotated function. Furthermore, it will prevent the compiler from
> + * inlining the function because inlining currently breaks the
> + * blacklisting mechanism of AddressSanitizer.
> + */
> +#if defined(__has_feature)
> +# if __has_feature(address_sanitizer)
> +# define UL_ASAN_BLACKLIST __attribute__((no_sanitize_address))
> +# else
> +# define UL_ASAN_BLACKLIST /* nothing */
> +# endif
> +#else
> +# define UL_ASAN_BLACKLIST /* nothing */
> +#endif
> +

it would be better to follow our current manner and use directly
__attribute__ in code than introduce extra layer of macros. All
you need is define empty no_sanitize_address
if !__has_feature(address_sanitizer).

Karel

--
Karel Zak <kzak@redhat.com>