Skip to content

Commit

Permalink
maint: allow selecting compiler for ManyConfigTests
Browse files Browse the repository at this point in the history
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
  • Loading branch information
carenas committed Jan 12, 2025
1 parent 76cee6c commit 2344071
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion maint/ManyConfigTests
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/pcre2_jit_neon_inc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 2344071

Please sign in to comment.