Squashed 'src/minisketch/' changes from d1bd01e189..4a179c61e3

4a179c61e3 Merge bitcoin-core/minisketch#102: Avoid Clang's `-Wunused-template` under restricted field selections
d14cd495ff Avoid Clang's `-Wunused-template` under restricted field selections

git-subtree-dir: src/minisketch
git-subtree-split: 4a179c61e3cbe3ac2b3c027764ce8eb5183155e1
This commit is contained in:
fanquake
2026-08-15 15:05:06 +01:00
parent 4543a3bde2
commit 461e3be8d3
2 changed files with 17 additions and 2 deletions

View File

@@ -12,6 +12,7 @@
#include "../int_utils.h"
#include "../lintrans.h"
#include "../util.h"
namespace {
@@ -28,7 +29,7 @@ namespace {
# define NO_SANITIZE_MEMORY
#endif
template<typename I, int BITS, I MOD> NO_SANITIZE_MEMORY I MulWithClMulReduce(I a, I b)
template<typename I, int BITS, I MOD> NO_SANITIZE_MEMORY MAYBE_UNUSED I MulWithClMulReduce(I a, I b)
{
static constexpr I MASK = Mask<BITS, I>();
@@ -65,7 +66,7 @@ template<typename I, int BITS, I MOD> NO_SANITIZE_MEMORY I MulWithClMulReduce(I
}
}
template<typename I, int BITS, int POS> NO_SANITIZE_MEMORY I MulTrinomial(I a, I b)
template<typename I, int BITS, int POS> NO_SANITIZE_MEMORY MAYBE_UNUSED I MulTrinomial(I a, I b)
{
static constexpr I MASK = Mask<BITS, I>();

View File

@@ -26,6 +26,20 @@
#define EXPECT(x,c) (x)
#endif
#if defined(__has_cpp_attribute)
# if __has_cpp_attribute(maybe_unused)
# define MAYBE_UNUSED [[maybe_unused]]
# endif
#endif
#ifndef MAYBE_UNUSED
# if defined(__GNUC__)
# define MAYBE_UNUSED __attribute__((unused))
# else
# define MAYBE_UNUSED
# endif
#endif
/* Assertion macros */
/**