Arm Community
Site
Search
User
Site
Search
User
Support forums
Compilers and Libraries forum
Problem with rand_r() and strnlen()
State
Not Answered
Locked
Locked
Replies
2 replies
Subscribers
21 subscribers
Views
3254 views
Users
0 members are here
Options
Share
More actions
Related
How was your experience today?
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion
Problem with rand_r() and strnlen()
skysurf99
over 5 years ago
Hello,
I am currently currently using the ARM 6.6.1 compiler and running into an issue while using the rand_r() and strnlen() functions in the code below,
static inline uint32_t MCM_RandR(uint32_t *const aSeed)
{
return
rand_r((unsigned int*)aSeed)
;
}
This results in the following error:
implicit declaration of function 'rand_r' is invalid in C99 [-Wimplicit-function-declaration]
return rand_r((unsigned int*)aSeed);
Similarly I am running into a similar issue with the strnlen function which gives the below error when compiling,
warning: implicit declaration of function 'strnlen' is invalid in C99 [-Wimplicit-function-declaration]
len = strnlen(logBuf, ULOG_STR_MAX_SIZE);
The above code and both function calls compile fine with the ARM 6.6.2 compiler version, however with the 6.6.1 version I am getting the above errors.
Are these functions not supported in the 6.6.1 compiler as they are in 6.6.2? Are there any compiler options or settings that might enable their support in 6.6.1?
Would appreciate any feedback and thank you in advance for your help.
0
Quote