keystone-enclave / keystone-sdk

SDK for Keystone Enclave - ABI/SBI libraries and sample apps
Other
44 stars 22 forks source link

Quantifier const in strlen #44

Open Nisiyama-Suzune opened 4 years ago

Nisiyama-Suzune commented 4 years ago

../keyedge/ocalls_eapp.h: In function 'print_string':
../keyedge/ocalls_eapp.h:34:39: error: passing argument 1 of 'strlen' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
  size_t __0_msg_keyedge_size = strlen(msg) + 1;
                                       ^~~
In file included from ../keyedge/flatbuffers_common_reader.h:221:0,
                 from ../keyedge/ocalls_reader.h:7,
                 from ../keyedge/ocalls_builder.h:7,
                 from ../keyedge/ocalls_eapp.h:6,
                 from eapp.c:2:
/home/nisiyama/keystone/sdk/lib/app/include/string.h:9:8: note: expected 'char *' but argument is of type 'const char *'
 size_t strlen(char* str);
        ^~~~~~

I think we might have dropped the const part of const char* in strlen. Is it intentional?