Skip to content

Commit

Permalink
Guard GCC-specific macros with !defined(__clang__)
Browse files Browse the repository at this point in the history
By default Clang on Linux defines the macro `__GNUC__`, so to guard GCC-specific
code paths it isn't sufficient to check `#ifdef __GNUC__`.
  • Loading branch information
giordano committed Feb 26, 2022
1 parent a2e4226 commit 11ee8df
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/julia_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,8 @@ jl_svec_t *jl_perm_symsvec(size_t n, ...);

// this sizeof(__VA_ARGS__) trick can't be computed until C11, but that only matters to Clang in some situations
#if !defined(__clang_analyzer__) && !(defined(_COMPILER_ASAN_ENABLED_) || defined(_COMPILER_TSAN_ENABLED_))
#ifdef __GNUC__
// Following macros are only for GCC, but Clang on Linux may define `__GNUC__`, so we have to exclude it.
#if defined(__GNUC__) && !defined(__clang__)
#define jl_perm_symsvec(n, ...) \
(jl_perm_symsvec)(__extension__({ \
static_assert( \
Expand Down

0 comments on commit 11ee8df

Please sign in to comment.