]> Git Repo - secp256k1.git/commitdiff
Merge #773: Fix some compile problems on weird/old compilers.
authorTim Ruffing <[email protected]>
Sun, 26 Jul 2020 09:05:08 +0000 (11:05 +0200)
committerTim Ruffing <[email protected]>
Sun, 26 Jul 2020 09:06:33 +0000 (11:06 +0200)
1309c03c45beece646a7d21fdb6a0e3d38adee2b Fix some compile problems on weird/old compilers. (Gregory Maxwell)

Pull request description:

  The visibility attribute is a GCC 4+ feature.
  GCC 2.95 also warns about the unsigned/signed comparision.

ACKs for top commit:
  real-or-random:
    ACK 1309c03c45beece646a7d21fdb6a0e3d38adee2b I inspected the diff

Tree-SHA512: b5a5175416b67b2619f68ad82a208052ad678955e59c2f3457799abd1dd6fd817c40f6bc2941b2bda207c6f58ad0fbe46221a2f92b726e824702c4c0b177377c

include/secp256k1.h
src/secp256k1.c

index 2ba2dca388150280773063aa7ed20235ee34d7fa..2178c8e2d6f1864b563f0087c829372804f2cd78 100644 (file)
@@ -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
index b03a6e634596192375e27e54e5c2a2e114633482..3e7926503825dd4d868da82bcaba9be9822a416c 100644 (file)
@@ -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);
This page took 0.030726 seconds and 4 git commands to generate.