Merge bitcoin-core/secp256k1#987: Fix unused parameter warnings when building without VERIFY

189f6bcfef Fix unused parameter warnings when building without VERIFY (Jonas Nick)

Pull request description:

  This commit makes `./configure --enable-coverage && make check` free of warnings.

ACKs for top commit:
  practicalswift:
    cr ACK 189f6bcfef
  elichai:
    utACK 189f6bcfef
  siv2r:
    Tested ACK 189f6bc

Tree-SHA512: 727fe0e40ff61f404780b32dfa4102a58bed9d922e61bd17ddaaf1243b0c06edd9697ff4763b5e92d033e7db3778193bee07d85cfa3b9c46d45e5fec3f568009
This commit is contained in:
Tim Ruffing 2021-10-12 16:17:31 +02:00
commit 10f9bd84f4
No known key found for this signature in database
GPG Key ID: 8C461CCD293F6011
1 changed files with 2 additions and 0 deletions

View File

@ -140,6 +140,8 @@ static SECP256K1_INLINE void *manual_alloc(void** prealloc_ptr, size_t alloc_siz
VERIFY_CHECK((unsigned char*)*prealloc_ptr >= (unsigned char*)base); VERIFY_CHECK((unsigned char*)*prealloc_ptr >= (unsigned char*)base);
VERIFY_CHECK(((unsigned char*)*prealloc_ptr - (unsigned char*)base) % ALIGNMENT == 0); VERIFY_CHECK(((unsigned char*)*prealloc_ptr - (unsigned char*)base) % ALIGNMENT == 0);
VERIFY_CHECK((unsigned char*)*prealloc_ptr - (unsigned char*)base + aligned_alloc_size <= max_size); VERIFY_CHECK((unsigned char*)*prealloc_ptr - (unsigned char*)base + aligned_alloc_size <= max_size);
/* Avoid unused parameter warnings when building without VERIFY */
(void) base; (void) max_size;
ret = *prealloc_ptr; ret = *prealloc_ptr;
*prealloc_ptr = (unsigned char*)*prealloc_ptr + aligned_alloc_size; *prealloc_ptr = (unsigned char*)*prealloc_ptr + aligned_alloc_size;
return ret; return ret;