snprintf() with g++ -std=c++98: error: 'snprintf' was not declared in this scope

Yaakov (Cygwin/X) yselkowitz@users.sourceforge.net
Wed Apr 4 22:54:00 GMT 2012


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



More information about the Cygwin mailing list