From 0df54921bc3567db80eb894b01b2b5a6ea3d7c02 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 3 Dec 2018 17:38:50 +0100 Subject: [PATCH] tree-wide: use new macro HAS_FEATURE_ADDRESS_SANITIZER everywhere --- src/journal/lookup3.c | 6 +++--- src/libsystemd/sd-bus/test-bus-marshal.c | 2 +- src/test/test-capability.c | 2 +- src/test/test-execute.c | 2 +- src/test/test-sigbus.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/journal/lookup3.c b/src/journal/lookup3.c index ff194dd9517..6c61f17c7db 100644 --- a/src/journal/lookup3.c +++ b/src/journal/lookup3.c @@ -319,7 +319,7 @@ uint32_t jenkins_hashlittle( const void *key, size_t length, uint32_t initval) * still catch it and complain. The masking trick does make the hash * noticeably faster for short strings (like English words). */ -#if !VALGRIND && !defined(__SANITIZE_ADDRESS__) +#if !VALGRIND && !HAS_FEATURE_ADDRESS_SANITIZER switch(length) { @@ -504,7 +504,7 @@ void jenkins_hashlittle2( * still catch it and complain. The masking trick does make the hash * noticeably faster for short strings (like English words). */ -#if !VALGRIND && !defined(__SANITIZE_ADDRESS__) +#if !VALGRIND && !HAS_FEATURE_ADDRESS_SANITIZER switch(length) { @@ -680,7 +680,7 @@ uint32_t jenkins_hashbig( const void *key, size_t length, uint32_t initval) * still catch it and complain. The masking trick does make the hash * noticeably faster for short strings (like English words). */ -#if !VALGRIND && !defined(__SANITIZE_ADDRESS__) +#if !VALGRIND && !HAS_FEATURE_ADDRESS_SANITIZER switch(length) { diff --git a/src/libsystemd/sd-bus/test-bus-marshal.c b/src/libsystemd/sd-bus/test-bus-marshal.c index d1c674b223a..1e9810ce4fb 100644 --- a/src/libsystemd/sd-bus/test-bus-marshal.c +++ b/src/libsystemd/sd-bus/test-bus-marshal.c @@ -202,7 +202,7 @@ int main(int argc, char *argv[]) { log_info("message size = %zu, contents =\n%s", sz, h); #if HAVE_GLIB -#ifndef __SANITIZE_ADDRESS__ +#if !HAS_FEATURE_ADDRESS_SANITIZER { GDBusMessage *g; char *p; diff --git a/src/test/test-capability.c b/src/test/test-capability.c index 5bfcc385d9e..dae85f2f91c 100644 --- a/src/test/test-capability.c +++ b/src/test/test-capability.c @@ -20,7 +20,7 @@ static uid_t test_uid = -1; static gid_t test_gid = -1; -#ifdef __SANITIZE_ADDRESS__ +#if HAS_FEATURE_ADDRESS_SANITIZER /* Keep CAP_SYS_PTRACE when running under Address Sanitizer */ static const uint64_t test_flags = UINT64_C(1) << CAP_SYS_PTRACE; #else diff --git a/src/test/test-execute.c b/src/test/test-execute.c index fdde079cefc..2115061addc 100644 --- a/src/test/test-execute.c +++ b/src/test/test-execute.c @@ -759,7 +759,7 @@ int main(int argc, char *argv[]) { test_setup_logging(LOG_DEBUG); -#ifdef __SANITIZE_ADDRESS__ +#if HAS_FEATURE_ADDRESS_SANITIZER if (is_run_on_travis_ci()) { log_notice("Running on TravisCI under ASan, skipping, see https://github.com/systemd/systemd/issues/10696"); return EXIT_TEST_SKIP; diff --git a/src/test/test-sigbus.c b/src/test/test-sigbus.c index 33c9d42e9e3..d2666dd1d8e 100644 --- a/src/test/test-sigbus.c +++ b/src/test/test-sigbus.c @@ -19,7 +19,7 @@ int main(int argc, char *argv[]) { test_setup_logging(LOG_INFO); -#ifdef __SANITIZE_ADDRESS__ +#if HAS_FEATURE_ADDRESS_SANITIZER return log_tests_skipped("address-sanitizer is enabled"); #endif #if HAVE_VALGRIND_VALGRIND_H -- 2.47.3