This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: 1.7: snprintf() with gcc -std=c99: warning about implicit declaration
- From: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- To: cygwin at cygwin dot com
- Date: Mon, 20 Apr 2009 03:42:50 +0100
- Subject: Re: 1.7: snprintf() with gcc -std=c99: warning about implicit declaration
- References: <alpine.LNX.2.00.0904192315360.3751@fenrir.sidaroth.foo>
Markus Rinne wrote:
> It seems gcc defines __STRICT_ANSI__ when passed the -std=c99 option
That much, at any rate, is as-expected and correct.
> and the declaration of snprintf is enclosed in #ifndef __STRICT_ANSI__
> in stdio.h.
Ah. Yes, newlib (from where Cygwin takes stdio.h) does not fully support
C99; it is basically C90-compliant[*], and snprintf is not in C90. It might
be reasonable to submit a patch to newlib that moved snprintf to somewhere it
could be conditioned on something like
#if !defined(__STRICT_ANSI__) || (__STDC_VERSION__ >= 199901L)
I wonder how many other functions would need the same treatment, do you
happen to have an idea?
cheers,
DaveK
--
[*] - "C90-compliant plus extras"
http://sourceware.org/ml/newlib/2006/msg00673.html
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/