From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: util-linux-owner@vger.kernel.org Received: from mx1.redhat.com ([209.132.183.28]:37655 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932752AbaKMOst (ORCPT ); Thu, 13 Nov 2014 09:48:49 -0500 Date: Thu, 13 Nov 2014 15:48:35 +0100 From: Karel Zak To: Sami Kerola Cc: kerolasa@gmail.com, Boris Egorov , util-linux Subject: Re: [PATCH 0/6] pull: almost working AddressSanitizer support Message-ID: <20141113144835.GD6704@x2.net.home> References: <1415656195-20458-1-git-send-email-kerolasa@iki.fi> <5461B803.4050707@linux.com> <20141112142500.GB5530@x2.net.home> <20141112195131.GA3902@vapier.wh0rd.info> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: Sender: util-linux-owner@vger.kernel.org List-ID: 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 http://karelzak.blogspot.com