[compiler-rt] 78d3e0a - sanitizer: Fix -Wpedantic GCC warning
Martin Liska via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 5 10:05:56 PDT 2021
Author: Martin Liska
Date: 2021-11-05T18:05:23+01:00
New Revision: 78d3e0a4f1406b17cdecc77540e09210670fe9a9
URL: https://github.com/llvm/llvm-project/commit/78d3e0a4f1406b17cdecc77540e09210670fe9a9
DIFF: https://github.com/llvm/llvm-project/commit/78d3e0a4f1406b17cdecc77540e09210670fe9a9.diff
LOG: sanitizer: Fix -Wpedantic GCC warning
Fixes:
sanitizer_stacktrace.h:212:5: warning: ISO C++ forbids braced-groups within expressions [-Wpedantic]
Differential Revision: https://reviews.llvm.org/D113292
Added:
Modified:
compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h
Removed:
################################################################################
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h b/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h
index ea330f36f7d79..11c6154b09ea7 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.h
@@ -209,11 +209,11 @@ static inline bool IsValidFrame(uptr frame, uptr stack_top, uptr stack_bottom) {
// StackTrace::GetCurrentPc() faster.
#if defined(__x86_64__)
# define GET_CURRENT_PC() \
- ({ \
+ (__extension__({ \
uptr pc; \
asm("lea 0(%%rip), %0" : "=r"(pc)); \
pc; \
- })
+ }))
#else
# define GET_CURRENT_PC() StackTrace::GetCurrentPc()
#endif
More information about the llvm-commits
mailing list