...
The TR24731-1 tmpfile_s() function should not be used with implementations that create temporary files in shared directory such as /tmp or C: because the function does not allow the user to specify a directory in which the temporary file should be created (see VOID FIO15-A. Do not create temporary files in shared directories).
Compliant Solution: mkstemp() (POSIX)
...