bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mkstemp declaration fix


From: Bruno Haible
Subject: mkstemp declaration fix
Date: Tue, 20 Mar 2007 01:40:53 +0100
User-agent: KMail/1.5.4

Hello,

On MacOS X 10.3, one gets this warning:

mkstemp-safer.c:34: warning: implicit declaration of function `mkstemp'

The reason is that mkstemp is declared in <unistd.h>, not <stdlib.h>, on
this platform. But for POSIX compatibility, only gnulib's <stdlib.h> should
be sufficient to declare the function. I'm applying this:


2007-03-17  Bruno Haible  <address@hidden>

        * modules/stdlib (Depends-on): Add unistd.
        * lib/stdlib_.h: Include <unistd.h> if mkstemp is desired.
        Needed for MacOS X 10.3.

*** lib/stdlib_.h       9 Mar 2007 23:34:42 -0000       1.6
--- lib/stdlib_.h       17 Mar 2007 18:59:35 -0000
***************
*** 120,125 ****
--- 120,128 ----
     set.  */
  #  define mkstemp rpl_mkstemp
  extern int mkstemp (char *template);
+ # else
+ /* On MacOS X 10.3, only <unistd.h> declares mkstemp.  */
+ #  include <unistd.h>
  # endif
  #elif defined GNULIB_POSIXCHECK
  # undef mkstemp
*** modules/stdlib      19 Feb 2007 00:08:40 -0000      1.2
--- modules/stdlib      17 Mar 2007 18:59:35 -0000
***************
*** 8,13 ****
--- 8,14 ----
  Depends-on:
  absolute-header
  link-warning
+ unistd
  
  configure.ac:
  gl_STDLIB_H





reply via email to

[Prev in Thread] Current Thread [Next in Thread]