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: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Terry Guo <flameroc at gmail dot com>
- Cc: "libstdc++" <libstdc++ at gcc dot gnu dot org>
- Date: Wed, 6 Nov 2013 09:44:33 +0000
- 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>
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.