calling string function in freertos

usual-developer wrote on Tuesday, April 16, 2019:

How to call String related function like strcmp, strcpy,strstr,etc in FreeRTOS. Is there any specific way to call or can we use it as in normal C program?

Thanks in advance…

richarddamon wrote on Tuesday, April 16, 2019:

Most C functions can be used just a normal, since you are just running a C program. The main cases you run into issues those functions that store some state intrnally (like malloc and free which keep the state of the heap) where either they need to be coded to handle the multi-tasking nature of a OS, or you need to externally protect them to avoid re-entrancey, or functions that will want to ask for help from the OS (like file handling functions) where you will need proper ‘drivers’ to provide that support.

String functions generally have no issue, except things like strdup(), where you need to make sure the heap operation is made safe,

heinbali01 wrote on Tuesday, April 16, 2019:

Another exception is the C-function strtok(), it is non-reentrant.
It has safe alternatives: strtok_r() or strtok_s()