Hi,
I tried to use 'strnlen' or 'strnlen_s' in MDK, no matter what 'Language C' standard I choose, the compiler throws
" warning: implicit declaration of function 'strnlen_s' is invalid in C99 [-Wimplicit-function-declaration]"
So, any method to eliminate this warning?
Thanks.
try adding #include "string.h"
Hi, I've included <string.h>. There is nothing special, I think you can try and reproduce the same result easily.
adding #include "string.h" can resolve the warning on my side for strnlen
Which C language standard do you choose? It won't work on my side with V5.33.
strnlen_s is defined in C11, but the implementation is not available in either ARMCC or ARMCLANG in MDK 5.33. At least, it's not defined in any of the header files that ship with the compilers.
strnlen isn't defined either. And neither function is mentioned in the C/C++ Libraries book.
Thanks for the answer, what confuse me now:
1. It only throw warning, but not error. (May because my code is in compiling stage, hasn't go to link stage ?).
2. It always say 'C99', no matter what standard I choose.