Re: ASAN and dhcpcd with privilege separation

Kamil Rytarowski <[email protected]>
Newsgroups gmane.os.netbsd.devel.toolchain
Message-ID <[email protected]>
On 31.01.2021 13:21, Roy Marples wrote:
> 
> What I want to end up with is some #ifdef SANITIZE foo so that enough is
> disabled to make it work.

You can use something like this:

#ifndef __has_feature
#define __has_feature(x)        0
#endif

#if __has_feature(address_sanitizer) || \
    defined(__SANITIZE_ADDRESS__) || \
    __has_feature(leak_sanitizer) || \
    defined(__SANITIZE_LEAK__)

asan_lsan_code_here();

#else

no_asan_lsan_code_here();

#endif


__SANITIZE_LEAK__ is a NetBSD GCC extension.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.