aitos-io / BoAT-X-Framework

BoAT-X Blockchain Application Framework for IoT
http://www.aitos.io
Apache License 2.0
926 stars 49 forks source link

Compile warning in function check_chainmaker_wallet #1226

Open PanHH opened 1 year ago

PanHH commented 1 year ago

Describe the bug Compile warning in function check_chainmaker_wallet

01Wallet.c: In function 'check_chainmaker_wallet':
01Wallet.c:29:22: warning: pointer targets in passing argument 1 of 'strncmp' differ in signedness [-Wpointer-sign]
     result = strncmp(wallet_ptr->user_cert_prikey_info.prikeyCtx.extra_data.value, chainmaker_sign_key_buf, strlen(chainmaker_sign_key_buf));
                      ^~~~~~~~~~
In file included from /usr/include/check.h:26:0,
                 from tcase_chainmaker.h:22,
                 from 01Wallet.c:16:
/usr/include/string.h:139:12: note: expected 'const char *' but argument is of type 'BUINT8 * {aka unsigned char *}'
 extern int strncmp (const char *__s1, const char *__s2, size_t __n)
            ^~~~~~~
01Wallet.c:35:22: warning: pointer targets in passing argument 1 of 'strncmp' differ in signedness [-Wpointer-sign]
     result = strncmp(wallet_ptr->user_cert_prikey_info.cert.field_ptr, chainmaker_sign_cert_buf, strlen(chainmaker_sign_cert_buf));
                      ^~~~~~~~~~
In file included from /usr/include/check.h:26:0,
                 from tcase_chainmaker.h:22,
                 from 01Wallet.c:16:
/usr/include/string.h:139:12: note: expected 'const char *' but argument is of type 'BUINT8 * {aka unsigned char *}'
 extern int strncmp (const char *__s1, const char *__s2, size_t __n)
            ^~~~~~~

1667295993372