This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Using -std=c++11 to test all c99 functions for libstdc++ configuration
- From: Terry Guo <flameroc at gmail dot com>
- To: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Cc: "libstdc++" <libstdc++ at gcc dot gnu dot org>
- Date: Wed, 6 Nov 2013 18:12:22 +0800
- Subject: Re: Using -std=c++11 to test all c99 functions for libstdc++ configuration
- Authentication-results: sourceware.org; auth=none
- References: <CAGbRaL5ayqYQiidC4xfGsHZ2PJwgBOFZ-1H6+BnpFxH5LDMJ+Q at mail dot gmail dot com> <CAH6eHdRL6+61VUX9LLZsG-Cgm83cjdxquGQSmk4eMDyUZ4=y2w at mail dot gmail dot com>
On Wed, Nov 6, 2013 at 5:44 PM, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> On 6 November 2013 09:03, Terry Guo wrote:
>> Hi there,
>>
>> I noticed all the c99 function test cases are still compiled with
>> option -std=c++98 during the configuration of libstdc++. Does this
>> make sense? Why don't use -std=c++11? I am a newbie. I just feel the
>> year 98 is older than the year 99 which means in the year 98 you can't
>> have functions developed in year 99. Thanks for any help.
>
> Because sometimes we want to use C99 functions in C++98 mode, e.g. in
> locales we want to use vsnprintf if it's available. GNU libc makes
> all C99 features available when _GNU_SOURCE is defined, and G++ always
> defines that on GNU/Linux.
>
> If we only tested if they are available when using -std=c++11 that
> doesn't tell us if they are available in C++98 mode.
>
> In other parts of the library we only need C99 functions for C++11
> features, and so it would make sense to have a separate macro for
> them, which is set by configure tests using -std=c++11. Someone needs
> to audit the library and figure out what would need to change to do
> that.
Thanks Jonathan. I understand it now.
BR,
Terry