X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-5.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Message-ID: <4F7CD104.5020908@users.sourceforge.net> Date: Wed, 04 Apr 2012 17:53:56 -0500 From: "Yaakov (Cygwin/X)" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: snprintf() with g++ -std=c++98: error: 'snprintf' was not declared in this scope References: <20120404133244 DOT GA2056 AT qp9482> <4F7C5470 DOT 3070805 AT cs DOT utoronto DOT ca> <20120404145445 DOT GA1548 AT qp9482> <20120404151837 DOT GA11484 AT calimero DOT vinschen DOT de> In-Reply-To: <20120404151837.GA11484@calimero.vinschen.de> Content-Type: text/plain; charset=UTF-8; format=flowed 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 On 2012-04-04 10:18, Corinna Vinschen wrote: > On Apr 4 16:54, Denis Excoffier wrote: >> -#if !defined(__STRICT_ANSI__) || (__STDC_VERSION__>= 199901L) >> +#if !defined(__STRICT_ANSI__) || (__STDC_VERSION__>= 199901L) || (__cplusplus>= 201103L) > > How is that supposed to work? > > $ gcc -xc++ -std=c++98 -dM -E -< /dev/null | grep cplus > #define __cplusplus 1 > > $ gcc -xc++ -std=c++0x -dM -E -< /dev/null | grep cplus > #define __cplusplus 1 > > Actually I'm wondering if that's not a bug in gcc: It is, and it has been fixed in 4.7.0[1]: > G++ now sets the predefined macro __cplusplus to the correct value, > 199711L for C++98/03, and 201103L for C++11. That being said, there are many such issues in the newlib and Cygwin headers. Yaakov [1] http://gcc.gnu.org/gcc-4.7/changes.html -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple