Skip to content

Commit

Permalink
Merge bitcoin#819: Enable -Wundef warning
Browse files Browse the repository at this point in the history
e73ff30 Enable -Wundef warning (Tim Ruffing)

Pull request description:

ACKs for top commit:
  practicalswift:
    ACK e73ff30 -- patch looks correct
  sipa:
    ACK e73ff30
  jonasnick:
    ACK e73ff30

Tree-SHA512: 1f0d477e41f33276eceb5324162731ba8aacd8d6571d7020344206b31c7f48c31f6bccbed2ce3ffe2e8c13abf98db24d177521b6b36a3087b81b55a253559fe6
  • Loading branch information
jonasnick committed Sep 19, 2020
2 parents 4ad408f + e73ff30 commit 7ceb0b7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ esac

CFLAGS="-W $CFLAGS"

warn_CFLAGS="-std=c89 -pedantic -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes -Wno-unused-function -Wno-long-long -Wno-overlength-strings"
warn_CFLAGS="-std=c89 -pedantic -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wstrict-prototypes -Wundef -Wno-unused-function -Wno-long-long -Wno-overlength-strings"
saved_CFLAGS="$CFLAGS"
CFLAGS="$warn_CFLAGS $CFLAGS"
AC_MSG_CHECKING([if ${CC} supports ${warn_CFLAGS}])
Expand Down
20 changes: 10 additions & 10 deletions src/valgrind_ctime_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
#include "assumptions.h"
#include "util.h"

#if ENABLE_MODULE_ECDH
#ifdef ENABLE_MODULE_ECDH
# include "include/secp256k1_ecdh.h"
#endif

#if ENABLE_MODULE_RECOVERY
#ifdef ENABLE_MODULE_RECOVERY
# include "include/secp256k1_recovery.h"
#endif

#if ENABLE_MODULE_EXTRAKEYS
#ifdef ENABLE_MODULE_EXTRAKEYS
# include "include/secp256k1_extrakeys.h"
#endif

#if ENABLE_MODULE_SCHNORRSIG
#ifdef ENABLE_MODULE_SCHNORRSIG
#include "include/secp256k1_schnorrsig.h"
#endif

Expand All @@ -37,11 +37,11 @@ int main(void) {
unsigned char key[32];
unsigned char sig[74];
unsigned char spubkey[33];
#if ENABLE_MODULE_RECOVERY
#ifdef ENABLE_MODULE_RECOVERY
secp256k1_ecdsa_recoverable_signature recoverable_signature;
int recid;
#endif
#if ENABLE_MODULE_EXTRAKEYS
#ifdef ENABLE_MODULE_EXTRAKEYS
secp256k1_keypair keypair;
#endif

Expand Down Expand Up @@ -81,15 +81,15 @@ int main(void) {
CHECK(ret);
CHECK(secp256k1_ecdsa_signature_serialize_der(ctx, sig, &siglen, &signature));

#if ENABLE_MODULE_ECDH
#ifdef ENABLE_MODULE_ECDH
/* Test ECDH. */
VALGRIND_MAKE_MEM_UNDEFINED(key, 32);
ret = secp256k1_ecdh(ctx, msg, &pubkey, key, NULL, NULL);
VALGRIND_MAKE_MEM_DEFINED(&ret, sizeof(ret));
CHECK(ret == 1);
#endif

#if ENABLE_MODULE_RECOVERY
#ifdef ENABLE_MODULE_RECOVERY
/* Test signing a recoverable signature. */
VALGRIND_MAKE_MEM_UNDEFINED(key, 32);
ret = secp256k1_ecdsa_sign_recoverable(ctx, &recoverable_signature, msg, key, NULL, NULL);
Expand Down Expand Up @@ -129,7 +129,7 @@ int main(void) {
CHECK(ret);

/* Test keypair_create and keypair_xonly_tweak_add. */
#if ENABLE_MODULE_EXTRAKEYS
#ifdef ENABLE_MODULE_EXTRAKEYS
VALGRIND_MAKE_MEM_UNDEFINED(key, 32);
ret = secp256k1_keypair_create(ctx, &keypair, key);
VALGRIND_MAKE_MEM_DEFINED(&ret, sizeof(ret));
Expand All @@ -142,7 +142,7 @@ int main(void) {
CHECK(ret == 1);
#endif

#if ENABLE_MODULE_SCHNORRSIG
#ifdef ENABLE_MODULE_SCHNORRSIG
VALGRIND_MAKE_MEM_UNDEFINED(key, 32);
ret = secp256k1_keypair_create(ctx, &keypair, key);
VALGRIND_MAKE_MEM_DEFINED(&ret, sizeof(ret));
Expand Down

0 comments on commit 7ceb0b7

Please sign in to comment.