Fix unused variable warning on macOS + ASan

On non-ELF platforms, WEAK_SYMBOL_FUNC expands to a static variable. On
ASan, we don't use sdallocx. Clang then warns about an unused static
variable. Silence the warning.

Change-Id: I3d53519b669d435f3801f45e4b72c6ca4cd27a3b
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/53565
Reviewed-by: Bob Beck <bbe@google.com>
Auto-Submit: David Benjamin <davidben@google.com>
Commit-Queue: Bob Beck <bbe@google.com>
chromium-5359
David Benjamin 3 years ago committed by Boringssl LUCI CQ
parent 4d7b383e98
commit 28883d4d81
  1. 1
      crypto/mem.c

@ -183,6 +183,7 @@ void OPENSSL_free(void *orig_ptr) {
// ASan knows to intercept malloc and free, but not sdallocx. // ASan knows to intercept malloc and free, but not sdallocx.
#if defined(OPENSSL_ASAN) #if defined(OPENSSL_ASAN)
(void)sdallocx;
free(ptr); free(ptr);
#else #else
if (sdallocx) { if (sdallocx) {

Loading…
Cancel
Save