This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: [PATCH] Warn when using mktemp
On Mar 13 15:54, Joel Sherrill wrote:
> Corinna Vinschen wrote:
>> 2) Why is _mktemp_r in stdio.h rather than in stdlib.h?
>>
>>
>> That looks like a bug to me. I fixed that in the attached patch.
>>
>> On Mar 13 14:54, Brooks Moses wrote:
>>
>>> Doing a Google
>>> search on "mktemp mkstemp dangerous" mostly finds mailing-list threads
>>> of people who are annoyed by the warning.
>>>
>>
>> That's the idea of this warning at least on BSD and on Linux. And I'd
>> like to see this warning on Cygwin as well. Cygwin has a link time
>> warning for this but on one hand it's using STABS while the new GCC
>> for Cygwin now creates Dwarf2, and on the other hand this warning is
>> not even visible when linking an application using mktemp.
>>
>>
> I would rather RTEMS follow BSD, GNU/Linux and Cygwin
> on this one so we don't need any ifdef's. Feel free to slap
> our users for dangerous things too. :)
Ok, I applied the patch. Right after doing that I just found that
the declarations of _mkstemp_r and _mktemp_r were within the same
#ifndef _REENT_ONLY guarded section as mkstemp and mktemp. I fixed that
as well.
Corinna
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat