This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: [Bug c/11758] New: overriding tmpnam() on gcc 3.2.2 - redhat 9/'tmpnam is dangerous, better use mkstemp'
- From: "Zack Weinberg" <zack at codesourcery dot com>
- To: gcc-bugzilla at gcc dot gnu dot org
- Cc: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 01 Aug 2003 00:30:19 -0700
- Subject: Re: [Bug c/11758] New: overriding tmpnam() on gcc 3.2.2 - redhat 9/'tmpnam is dangerous, better use mkstemp'
- References: <20030801063239.11758.bsellers16@cox.net>
"bsellers16 at cox dot net" <gcc-bugzilla@gcc.gnu.org> writes:
> session.o(.text+0x18dc): In function `_make_zero_file':
> /home/sellers/software/gnewspost-0.6/src/
> session.o(.text+0x190d):/home/sellers/software/gnewspost-0.6/src/
>
> collect2: ld returned 1 exit status
> make[2]: *** [gnewspost] Error 1
>
> How can I override the error, so I can compile this code? I tried -w and
> several other flags. TIA.
You cannot override the error.
It is, after all, an *error*,
not a warning.
However, the error is not
what you think it is.
This is the error:
session.c:452: undefined reference to `errno'
which indicates that session.c declared errno itself
("extern int errno;")
instead of including <errno.h>.
It is disappointing to see this mistake
still being made in presumably modern code
(using gtk etc)
but eh.
The other message
session.c:450: the use of `tmpnam' is dangerous, better use `mkstemp'
is a warning,
despite the lack of the word "warning".
You cannot make it go away,
because it indicates a security hole.
But you will still be able to link the program
if you fix the other bug.
zw