Bit-Wasp / secp256k1-php

PHP bindings for bitcoin-core/secp256k1
The Unlicense
57 stars 37 forks source link

Warning on secp256k1 make from current master and error on secp256k1-php make #127

Closed andsol closed 5 years ago

andsol commented 5 years ago

Hello, I got following warning during secp256k1 make:

gcc -I. -g -O2 -Wall -Wextra -Wno-unused-function -c src/gen_context.c -o gen_context.o gcc gen_context.o -o gen_context ./gen_context CC src/libsecp256k1_la-secp256k1.lo CCLD libsecp256k1.la CC src/bench_verify.o CCLD bench_verify CC src/bench_sign.o CCLD bench_sign CC src/bench_internal-bench_internal.o CCLD bench_internal CC src/bench_ecmult-bench_ecmult.o CCLD bench_ecmult CC src/tests-tests.o In file included from src/secp256k1.c:15:0, from src/tests.c:17: src/ecmult_const_impl.h: In function ‘secp256k1_wnaf_const’: src/ecmult_const_impl.h:113:20: warning: ‘u’ may be used uninitialized in this function [-Wmaybe-uninitialized] wnaf[word] = u * global_sign; ^ CCLD tests CC src/exhaustive_tests-tests_exhaustive.o CCLD exhaustive_tests CC src/bench_ecdh.o CCLD bench_ecdh CC src/bench_recover.o CCLD bench_recover

For secp256k1-php make (master):

/bin/bash /home/www/erc20/secp256k1-php-master/secp256k1/libtool --mode=compile cc -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/home/www/erc20/secp256k1-php-master/secp256k1 -DPHP_ATOM_INC -I/home/www/erc20/secp256k1-php-master/secp256k1/include -I/home/www/erc20/secp256k1-php-master/secp256k1/main -I/home/www/erc20/secp256k1-php-master/secp256k1 -I/usr/include/php/20170718 -I/usr/include/php/20170718/main -I/usr/include/php/20170718/TSRM -I/usr/include/php/20170718/Zend -I/usr/include/php/20170718/ext -I/usr/include/php/20170718/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /home/www/erc20/secp256k1-php-master/secp256k1/secp256k1.c -o secp256k1.lo libtool: compile: cc -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/home/www/erc20/secp256k1-php-master/secp256k1 -DPHP_ATOM_INC -I/home/www/erc20/secp256k1-php-master/secp256k1/include -I/home/www/erc20/secp256k1-php-master/secp256k1/main -I/home/www/erc20/secp256k1-php-master/secp256k1 -I/usr/include/php/20170718 -I/usr/include/php/20170718/main -I/usr/include/php/20170718/TSRM -I/usr/include/php/20170718/Zend -I/usr/include/php/20170718/ext -I/usr/include/php/20170718/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /home/www/erc20/secp256k1-php-master/secp256k1/secp256k1.c -fPIC -DPIC -o .libs/secp256k1.o /home/www/erc20/secp256k1-php-master/secp256k1/secp256k1.c: In function 'zif_secp256k1_ecdh': /home/www/erc20/secp256k1-php-master/secp256k1/secp256k1.c:1444:5: error: too few arguments to function 'secp256k1_ecdh' result = secp256k1_ecdh(ctx, resultChars, pubkey, privKey->val); ^ In file included from /home/www/erc20/secp256k1-php-master/secp256k1/php_secp256k1.h:3:0, from /home/www/erc20/secp256k1-php-master/secp256k1/secp256k1.c:11: /usr/local/include/secp256k1_ecdh.h:42:48: note: declared here SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdh( ^ make: *** [secp256k1.lo] Error 1

afk11 commented 5 years ago

Solution https://github.com/Bit-Wasp/secp256k1-php/issues/124