public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/28310]  New: [improve]  warning: the use  of `mktemp' is dangerous, better use `mkstemp'
@ 2006-07-08  7:12 jari dot aalto at cante dot net
  2006-07-08 13:16 ` [Bug c/28310] " pinskia at gcc dot gnu dot org
  2006-07-10 16:23 ` jari dot aalto at cante dot net
  0 siblings, 2 replies; 3+ messages in thread
From: jari dot aalto at cante dot net @ 2006-07-08  7:12 UTC (permalink / raw)
  To: gcc-bugs

While compiling binutils-2.17 from (Debian) sources, gcc reports following:

    bucomm.o: In function `make_tempname':
    /usr/src/net/deb/src/binutils-2.17/binutils/bucomm.c:426: warning: the use\
 of `mktemp' is dangerous, better use `mkstemp'


The proper fix is to use `mkdtemp' in the code, but the error message
does not tell this. The developers may mistakenly disregard this
message when they think "Oh, I create directories and `mkstemp' cannot
create directories, so the warning does not apply to this code".

SUGGESTION

a) Add to the manual page, mkstemp.1, that this function works for files
   only. Add Crosss reference to mkdtemp and vice versa
   (from mkdtemp => mkstemp.1)

b) Implement better checking in gcc to differtiate directories from files
   when displaying warning about use of mktemp function.

   OR

   mention both mkstemp and mkdtemp in the warning message if the
   parser cannot know which is the case

- - -

Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/dash
Kernel: Linux 2.6.16-2-686
Locale: LANG=C, LC_CTYPE=C (charmap=ISO-8859-1) (ignored: LC_ALL set to en_US)

Versions of packages gcc depends on:
ii  cpp                           4:4.1.1-3  The GNU C preprocessor (cpp)
ii  gcc-4.1                       4.1.1-7    The GNU C compiler

Versions of packages gcc recommends:
ii  libc6-dev [libc-dev]          2.3.6-15   GNU C Library: Development Librar\
i


-- 
           Summary: [improve]  warning: the use  of `mktemp' is dangerous,
                    better use `mkstemp'
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jari dot aalto at cante dot net


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c/28310] [improve]  warning: the use  of `mktemp' is dangerous, better use `mkstemp'
  2006-07-08  7:12 [Bug c/28310] New: [improve] warning: the use of `mktemp' is dangerous, better use `mkstemp' jari dot aalto at cante dot net
@ 2006-07-08 13:16 ` pinskia at gcc dot gnu dot org
  2006-07-10 16:23 ` jari dot aalto at cante dot net
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-07-08 13:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-07-08 13:16 -------
This warning does not come from the GCC but instead the linker but really glibc
is where the warning is located, please report this bug to glibc.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c/28310] [improve]  warning: the use  of `mktemp' is dangerous, better use `mkstemp'
  2006-07-08  7:12 [Bug c/28310] New: [improve] warning: the use of `mktemp' is dangerous, better use `mkstemp' jari dot aalto at cante dot net
  2006-07-08 13:16 ` [Bug c/28310] " pinskia at gcc dot gnu dot org
@ 2006-07-10 16:23 ` jari dot aalto at cante dot net
  1 sibling, 0 replies; 3+ messages in thread
From: jari dot aalto at cante dot net @ 2006-07-10 16:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jari dot aalto at cante dot net  2006-07-10 16:23 -------
(In reply to comment #1)
> This warning does not come from the GCC but instead the linker but really glibc is where the warning is located, please report this bug to glibc.

Reported as:

  http://sources.redhat.com/bugzilla/show_bug.cgi?id=2898

Thanks.


-- 


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-07-10 16:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-08  7:12 [Bug c/28310] New: [improve] warning: the use of `mktemp' is dangerous, better use `mkstemp' jari dot aalto at cante dot net
2006-07-08 13:16 ` [Bug c/28310] " pinskia at gcc dot gnu dot org
2006-07-10 16:23 ` jari dot aalto at cante dot net

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 read-only IMAP folder(s) and NNTP newsgroup(s).