Search code examples
gccwarnings

Any way to disable `tempnam' is dangerous, better use `mkstemp' gcc warning?


I'm using tempnam() only to get the directory name, so this security warning does not apply to my case. How can I disable it? I couldn't find any switches to do it.


Solution

  • If you really only want the directory name, use the string constant macro P_tmpdir, defined in <stdio.h>.