In the empty project, I do npm install tiny-secp256k1 and get lots of warnings:
$ npm i npm install tiny-secp256k1
> tiny-secp256k1@1.0.1 install /Users/<username>/programming/learning_blockchain/blockchain_basics/node_modules/tiny-secp256k1
> node-gyp rebuild
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
CXX(target) Release/obj.target/secp256k1/native/addon.o
../native/addon.cpp:22:3: warning: suggest braces around initialization of
subobject [-Wmissing-braces]
...0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
{
../native/addon.cpp:239:2: warning: ignoring return value of function declared
with 'warn_unused_result' attribute [-Wunused-result]
secp256k1_ec_privkey_negate(context, tweak_negated); // returns 1 always
^~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
../native/addon.cpp:79:21: warning: comparison of integers of different signs:
'int' and 'unsigned long' [-Wsign-compare]
if (info.Length() <= index) return __isPointCompressed(p...
~~~~~~~~~~~~~ ^ ~~~~~
../native/addon.cpp:141:21: note: in instantiation of function template
specialization '(anonymous namespace)::assumeCompression<2,
Nan::FunctionCallbackInfo<v8::Value>, v8::Local<v8::Object> >' requested
here
const auto flags = assumeCompression<2>(info, pA);
^
../native/addon.cpp:79:21: warning: comparison of integers of different signs:
'int' and 'unsigned long' [-Wsign-compare]
if (info.Length() <= index) return __isPointCompressed(p...
~~~~~~~~~~~~~ ^ ~~~~~
../native/addon.cpp:173:21: note: in instantiation of function template
specialization '(anonymous namespace)::assumeCompression<1,
Nan::FunctionCallbackInfo<v8::Value>, v8::Local<v8::Object> >' requested
here
const auto flags = assumeCompression<1>(info, p);
^
../native/addon.cpp:86:21: warning: comparison of integers of different signs:
'int' and 'unsigned long' [-Wsign-compare]
if (info.Length() <= index) return SECP256K1_EC_COMPRESSED;
~~~~~~~~~~~~~ ^ ~~~~~
../native/addon.cpp:188:21: note: in instantiation of function template
specialization '(anonymous namespace)::assumeCompression<1,
Nan::FunctionCallbackInfo<v8::Value> >' requested here
const auto flags = assumeCompression<1>(info);
^
../native/addon.cpp:20:32: warning: unused variable 'ZERO'
[-Wunused-const-variable]
const std::array<uint8_t, 32> ZERO = {};
^
6 warnings generated.
CC(target) Release/obj.target/secp256k1/native/secp256k1/src/secp256k1.o
In file included from ../native/secp256k1/src/secp256k1.c:13:
../native/secp256k1/src/group_impl.h:686:12: warning: unused function
'secp256k1_gej_has_quad_y_var' [-Wunused-function]
static int secp256k1_gej_has_quad_y_var(const secp256k1_gej *a) {
^
../native/secp256k1/src/group_impl.h:113:13: warning: unused function
'secp256k1_ge_set_gej_var' [-Wunused-function]
static void secp256k1_ge_set_gej_var(secp256k1_ge *r, secp256k1_gej *a) {
^
../native/secp256k1/src/group_impl.h:267:12: warning: unused function
'secp256k1_gej_is_valid_var' [-Wunused-function]
static int secp256k1_gej_is_valid_var(const secp256k1_gej *a) {
^
In file included from ../native/secp256k1/src/secp256k1.c:15:
../native/secp256k1/src/ecmult_const_impl.h:123:13: warning: unused function
'secp256k1_ecmult_const' [-Wunused-function]
static void secp256k1_ecmult_const(secp256k1_gej *r, const secp256k1_ge ...
^
4 warnings generated.
SOLINK_MODULE(target) Release/secp256k1.node
npm WARN blockchain_basics@1.0.0 No description
npm WARN blockchain_basics@1.0.0 No repository field.
npm WARN blockchain_basics@1.0.0 No license field.
+ install@0.12.2
+ tiny-secp256k1@1.0.1
+ npm@6.8.0
added 427 packages from 794 contributors, updated 1 package and audited 33497 packages in 29.903s
found 2 vulnerabilities (1 low, 1 moderate)
run `npm audit fix` to fix them, or `npm audit` for details
is it possible to fix that?
Surprisingly, so many projects I work with, start from bitcoinjs-lib finish by ready to use wallets pull this warnings.
In the empty project, I do npm install tiny-secp256k1 and get lots of warnings: