If the C compiler and the OS support threads, then it will be safe.
If your compiler is on Windows, you want to make sure that you are linking to multi-threaded runtime libraries. Or, if your compiler supports the -pthread option or something similar, then it is also safe.
If the compiler has a flag, such as -pthread, do not assume that all are thread-safe unless you use this flag. Using the flag will link in different libraries and set different preprocessor macros. It is possible that a whole other thread-safe runtime is bound during the execution of this flag.
source share