Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.linux.development.apps > #848

Re: warning: implicit declaration of function ‘mkstemp’

From jt@toerring.de (Jens Thoms Toerring)
Newsgroups comp.os.linux.development.apps
Subject Re: warning: implicit declaration of function ‘mkstemp’
Date 2017-08-05 15:11 +0000
Organization Freie Universitaet Berlin
Message-ID <eum5hqF1ldqU1@mid.uni-berlin.de> (permalink)
References <olurnd$3b6$1@solani.org>

Show all headers | View raw


Philipp Klaus Krause <pkk@spth.de> wrote:
> When using mkstemp() in my C source, I get the gcc warning:

> warning: implicit declaration of function ‘mkstemp’

> Why?
> I use gcc 6.4.0 on a debian GNU/Linux system.
> <stdlib.h> is included. I use other POSIX functions  (such as
> ftruncate() and open()) that are not part of ISO C in the same source
> file, but get a warning for mkstemp() only.
> I tried using -D_POSIX_C_SOURCE=200112L, but still get the warning.

Try '-D_POSIX_C_SOURCE=200809' instead. That's what's required
according to the up-to-date version of the man page (see
<http://man7.org/linux/man-pages/man3/mkstemp.3.html>), and it
works for me. The (somewhat out-dated) man page on my system
also claims that '_POSIX_C_SOURCE=200112L' would do the the
trick, but it doesn't.

BTW, if you always want the newest version of the man pages
you can get them easily via git from

 git://git.kernel.org/pub/scm/docs/man-pages/man-pages.git

                          Best regards, Jens
-- 
  \   Jens Thoms Toerring  ___      jt@toerring.de
   \__________________________      http://toerring.de

Back to comp.os.linux.development.apps | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

warning: implicit declaration of function ‘mkstemp’ Philipp Klaus Krause <pkk@spth.de> - 2017-08-03 11:51 +0200
  Re: warning: implicit declaration of function ‘mkstemp’ Richard Kettlewell <invalid@invalid.invalid> - 2017-08-03 11:08 +0100
    Re: warning: implicit declaration of function ‘mkstemp’ Philipp Klaus Krause <pkk@spth.de> - 2017-08-03 12:30 +0200
  Re: warning: implicit declaration of function ‘mkstemp’ jt@toerring.de (Jens Thoms Toerring) - 2017-08-05 15:11 +0000
    Re: warning: implicit declaration of function ‘mkstemp’ Geoff Clare <geoff@clare.See-My-Signature.invalid> - 2017-08-07 13:47 +0100

csiph-web