* Shutting up a silly compiler warning
@ 2000-02-29 8:39 Bart Schaefer
2000-02-29 9:56 ` Jos Backus
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Bart Schaefer @ 2000-02-29 8:39 UTC (permalink / raw)
To: zsh-workers
Jos Backus just reported this one to me, from the FreeBSD compiler:
utils.o: In function `gettempname':
utils.o(.text+0x1bfa): warning: mktemp() possibly used unsafely; consider
using mkstemp()
Zsh does NOT use mktemp() unsafely, and it can't use mkstemp() because it
sometimes wants to create a FIFO or other non-plain-file. What's the way
to get rid of this warning without actually changing the code?
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Shutting up a silly compiler warning
2000-02-29 8:39 Shutting up a silly compiler warning Bart Schaefer
@ 2000-02-29 9:56 ` Jos Backus
2000-02-29 10:43 ` Ollivier Robert
2000-02-29 19:37 ` Dan Nelson
2 siblings, 0 replies; 4+ messages in thread
From: Jos Backus @ 2000-02-29 9:56 UTC (permalink / raw)
To: zsh-workers
On Tue, Feb 29, 2000 at 08:39:54AM +0000, Bart Schaefer wrote:
> utils.o: In function `gettempname':
> utils.o(.text+0x1bfa): warning: mktemp() possibly used unsafely; consider
> using mkstemp()
Some more info: ld emits this warning (in ldmain.c(warning_callback), it looks
like) because lib/libc/stdio/mktemp.c contains
__warn_references(mktemp,
"warning: mktemp() possibly used unsafely; consider using mkstemp()");
I don't see a way to suppress these offhand.
--
Jos Backus _/ _/_/_/ "Reliability means never
_/ _/ _/ having to say you're sorry."
_/ _/_/_/ -- D. J. Bernstein
_/ _/ _/ _/
Jos.Backus@nl.origin-it.com _/_/ _/_/_/ use Std::Disclaimer;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Shutting up a silly compiler warning
2000-02-29 8:39 Shutting up a silly compiler warning Bart Schaefer
2000-02-29 9:56 ` Jos Backus
@ 2000-02-29 10:43 ` Ollivier Robert
2000-02-29 19:37 ` Dan Nelson
2 siblings, 0 replies; 4+ messages in thread
From: Ollivier Robert @ 2000-02-29 10:43 UTC (permalink / raw)
To: zsh-workers
According to Bart Schaefer:
> Zsh does NOT use mktemp() unsafely, and it can't use mkstemp() because it
The problem is that for FreeBSD, mktemp() is considered as unsafe (like
gtes and some others).
> sometimes wants to create a FIFO or other non-plain-file. What's the way
> to get rid of this warning without actually changing the code?
The warning is emitted by the linker so I guess it is impossible to get
over it.
--
Ollivier ROBERT -=- Eurocontrol EEC/TEC -=- roberto@eurocontrol.fr
The Postman hits! The Postman hits! You have new mail.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Shutting up a silly compiler warning
2000-02-29 8:39 Shutting up a silly compiler warning Bart Schaefer
2000-02-29 9:56 ` Jos Backus
2000-02-29 10:43 ` Ollivier Robert
@ 2000-02-29 19:37 ` Dan Nelson
2 siblings, 0 replies; 4+ messages in thread
From: Dan Nelson @ 2000-02-29 19:37 UTC (permalink / raw)
To: Bart Schaefer; +Cc: zsh-workers
In the last episode (Feb 29), Bart Schaefer said:
> Jos Backus just reported this one to me, from the FreeBSD compiler:
>
> utils.o: In function `gettempname':
> utils.o(.text+0x1bfa): warning: mktemp() possibly used unsafely; consider
> using mkstemp()
>
> Zsh does NOT use mktemp() unsafely, and it can't use mkstemp()
> because it sometimes wants to create a FIFO or other non-plain-file.
(it being zsh, not mktemp(). This confused me the first time I read
this :)
> What's the way to get rid of this warning without actually changing
> the code?
Under FreeBSD, you can use the undocumented _mktemp() function to
bypass the linker warning. I don't know if the other BSDs implement
their warning message in the same way. Does OpenBSD print a similar
warning for sprintf? :)
char * _mktemp(char *path)
{ return(_gettemp(path, (int *)NULL, 0, 0) ? path : (char *)NULL);
}
__warn_references(mktemp, "warning: mktemp() possibly used unsafely; consider using mkstemp()");
char * mktemp(char *path)
{ return(_mktemp(path));
}
--
Dan Nelson
dnelson@emsphone.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2000-02-29 19:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-02-29 8:39 Shutting up a silly compiler warning Bart Schaefer
2000-02-29 9:56 ` Jos Backus
2000-02-29 10:43 ` Ollivier Robert
2000-02-29 19:37 ` Dan Nelson
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).