X-Recipient: archive-cygwin@delorie.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)" <yselkowitz@users.sourceforge.net>
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@cygwin.com
Subject: Re: snprintf() with g++ -std=c++98: error: 'snprintf' was not declared in this scope
References: <20120404133244.GA2056@qp9482> <4F7C5470.3070805@cs.utoronto.ca> <20120404145445.GA1548@qp9482> <20120404151837.GA11484@calimero.vinschen.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@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.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

