From 234407110ab6a905d65cae572a015a4661e57072 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= Date: Sun, 12 Jan 2025 14:26:54 -0800 Subject: [PATCH] maint: allow selecting compiler for ManyConfigTests Instead of hardcoding the compiler as `cc`, let a CC environment variable dictate which compiler to use. For example, in macOS/arm64 where the GNU compiler is provided by brew the following will allow using it instead of the system compiler (which ALSO answers to `gcc` eventhough is `clang`) % CC=gcc-13 maint/ManyConfigTests --- maint/ManyConfigTests | 3 ++- src/pcre2_jit_neon_inc.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/maint/ManyConfigTests b/maint/ManyConfigTests index d93feec88..6d0a98cfe 100755 --- a/maint/ManyConfigTests +++ b/maint/ManyConfigTests @@ -110,11 +110,12 @@ tmp=/tmp/pcre2testing CFLAGS="-g" OFLAGS="-O0" +CC="${CC:=cc}" ISGCC=0 # If the compiler is gcc, add a lot of warning switches. -cc --version >/tmp/pcre2ccversion 2>/dev/null +$CC --version >/tmp/pcre2ccversion 2>/dev/null if [ $? -eq 0 ] && grep GCC /tmp/pcre2ccversion >/dev/null; then ISGCC=1 CFLAGS="$CFLAGS -Wall" diff --git a/src/pcre2_jit_neon_inc.h b/src/pcre2_jit_neon_inc.h index d3d189289..8baa337f1 100644 --- a/src/pcre2_jit_neon_inc.h +++ b/src/pcre2_jit_neon_inc.h @@ -87,7 +87,7 @@ POSSIBILITY OF SUCH DAMAGE. #pragma GCC diagnostic ignored "-Wdeclaration-after-statement" #endif -#if (defined(__GNUC__) && __SANITIZE_ADDRESS__) \ +#if (defined(__GNUC__) && defined(__SANITIZE_ADDRESS__) && __SANITIZE_ADDRESS__ ) \ || (defined(__clang__) \ && ((__clang_major__ == 3 && __clang_minor__ >= 3) || (__clang_major__ > 3))) __attribute__((no_sanitize_address))