This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/11758] overriding tmpnam() on gcc 3.2.2 - redhat 9/ 'tmpnam is dangerous, better use mkstemp'


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11758



------- Additional Comments From zack at codesourcery dot com  2003-08-01 07:30 -------
Subject: Re:  New: overriding tmpnam() on gcc 3.2.2 - redhat 9/
 'tmpnam is dangerous, better use mkstemp'

"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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]