X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Message-ID: <49EBE12A.1080305@gmail.com> Date: Mon, 20 Apr 2009 03:42:50 +0100 From: Dave Korn User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: 1.7: snprintf() with gcc -std=c99: warning about implicit declaration References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-7 Content-Transfer-Encoding: 7bit Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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/