From 1309c03c45beece646a7d21fdb6a0e3d38adee2b Mon Sep 17 00:00:00 2001 From: Gregory Maxwell Date: Sun, 26 Jul 2020 05:25:14 +0000 Subject: [PATCH] Fix some compile problems on weird/old compilers. The visibility attribute is a GCC 4+ feature. GCC 2.95 also warns about the unsigned/signed comparision. --- include/secp256k1.h | 2 +- src/secp256k1.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/secp256k1.h b/include/secp256k1.h index 2ba2dca388150..2178c8e2d6f18 100644 --- a/include/secp256k1.h +++ b/include/secp256k1.h @@ -134,7 +134,7 @@ typedef int (*secp256k1_nonce_function)( # else # define SECP256K1_API # endif -# elif defined(__GNUC__) && defined(SECP256K1_BUILD) +# elif defined(__GNUC__) && (__GNUC__ >= 4) && defined(SECP256K1_BUILD) # define SECP256K1_API __attribute__ ((visibility ("default"))) # else # define SECP256K1_API diff --git a/src/secp256k1.c b/src/secp256k1.c index b03a6e6345961..3e7926503825d 100644 --- a/src/secp256k1.c +++ b/src/secp256k1.c @@ -291,7 +291,7 @@ int secp256k1_ec_pubkey_serialize(const secp256k1_context* ctx, unsigned char *o VERIFY_CHECK(ctx != NULL); ARG_CHECK(outputlen != NULL); - ARG_CHECK(*outputlen >= ((flags & SECP256K1_FLAGS_BIT_COMPRESSION) ? 33 : 65)); + ARG_CHECK(*outputlen >= ((flags & SECP256K1_FLAGS_BIT_COMPRESSION) ? 33u : 65u)); len = *outputlen; *outputlen = 0; ARG_CHECK(output != NULL);