This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc 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 libc/13908] New: mktemp() incorrectly flagged with __wur in stdlib.h


http://sourceware.org/bugzilla/show_bug.cgi?id=13908

             Bug #: 13908
           Summary: mktemp() incorrectly flagged with __wur in stdlib.h
           Product: glibc
           Version: 2.15
            Status: NEW
          Severity: minor
          Priority: P2
         Component: libc
        AssignedTo: unassigned@sourceware.org
        ReportedBy: dvw@phas.ubc.ca
                CC: drepper.fsp@gmail.com
    Classification: Unclassified


stdlib.h contains:

/* Generate a unique temporary file name from TEMPLATE.
   The last six characters of TEMPLATE must be "XXXXXX";
   they are replaced with a string that makes the file name unique.
   Returns TEMPLATE, or a null pointer if it cannot get a unique file name.  */
extern char *mktemp (char *__template) __THROW __nonnull ((1)) __wur;



The documentation here is incorrect: mktemp() always returns TEMPLATE, and sets
template[0] to 0 on failure, as required by POSIX.

Consequently, this declaration should not be marked with __wur.  The caller
gains no information by inspecting the return value of mktemp().  (Instead, it
should be checking template[0] to detect failure.)

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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