Skip to content

Commit

Permalink
Merge bitcoin-core/secp256k1#1274: test: Silent noisy clang warnings …
Browse files Browse the repository at this point in the history
…about Valgrind code on macOS x86_64

747ada3 test: Silent noisy clang warnings about Valgrind code on macOS x86_64 (Hennadii Stepanov)

Pull request description:

  Since bitcoin#1206, on macOS x86_64 with Valgrind installed, clang emits a massive amount of `-Wreserved-identifier` and `-Wreserved-macro-identifier` warnings from the `valgrind/valgrind.h` and `valgrind/memcheck.h` headers.

  This PR prevents warnings emitted for the Valgrind code.

ACKs for top commit:
  real-or-random:
    utACK 747ada3

Tree-SHA512: dd1b2b9db2d471939fdc30f9d8fd106a12f21ec5008ca98d8ebe3087d7ea352d564e8bbd0cec59a004e084af3a84d4680cb81f2ef6fe13cf164b7691e33f437d
  • Loading branch information
real-or-random committed Aug 16, 2023
2 parents b327abf + 747ada3 commit 5d8fa82
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/checkmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,14 @@
#if !defined SECP256K1_CHECKMEM_ENABLED
# if defined VALGRIND
# include <stddef.h>
# if defined(__clang__) && defined(__APPLE__)
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wreserved-identifier"
# endif
# include <valgrind/memcheck.h>
# if defined(__clang__) && defined(__APPLE__)
# pragma clang diagnostic pop
# endif
# define SECP256K1_CHECKMEM_ENABLED 1
# define SECP256K1_CHECKMEM_UNDEFINE(p, len) VALGRIND_MAKE_MEM_UNDEFINED((p), (len))
# define SECP256K1_CHECKMEM_DEFINE(p, len) VALGRIND_MAKE_MEM_DEFINED((p), (len))
Expand Down

0 comments on commit 5d8fa82

Please sign in to comment.