Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

gcc

warnings

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.

like image 290
jackhab Avatar asked Feb 12 '09 13:02

jackhab


1 Answers

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

like image 193
gnud Avatar answered May 21 '23 10:05

gnud