0#include <secp256k1.h>
1#include <secp256k1_schnorrsig.h>
2
3int main(void)
4{
5 secp256k1_schnorrsig_extraparams extraparams = SECP256K1_SCHNORRSIG_EXTRAPARAMS_INIT;
6 return 0;
7}
This compiles as C but not as C++.
clang++:
0x.cpp:6:52: error: initializer-string for char array is too long
1 secp256k1_schnorrsig_extraparams extraparams = SECP256K1_SCHNORRSIG_EXTRAPARAMS_INIT;
2 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3/secp256k1/include/secp256k1_schnorrsig.h:90:5: note: expanded from macro 'SECP256K1_SCHNORRSIG_EXTRAPARAMS_INIT'
4 SECP256K1_SCHNORRSIG_EXTRAPARAMS_MAGIC,\
5 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6/secp256k1/include/secp256k1_schnorrsig.h:88:48: note: expanded from macro 'SECP256K1_SCHNORRSIG_EXTRAPARAMS_MAGIC'
7#define SECP256K1_SCHNORRSIG_EXTRAPARAMS_MAGIC "\xda\x6f\xb3\x8c"
8 ^~~~~~~~~~~~~~~~~~
91 error generated.
g++
0In file included from x.cpp:2:0:
1x.cpp: In function ‘int main()’:
2/secp256k1/include/secp256k1_schnorrsig.h:93:1: error: initializer-string for array of chars is too long [-fpermissive]
3 }
4 ^
5x.cpp:6:52: note: in expansion of macro ‘SECP256K1_SCHNORRSIG_EXTRAPARAMS_INIT’
6 secp256k1_schnorrsig_extraparams extraparams = SECP256K1_SCHNORRSIG_EXTRAPARAMS_INIT;