This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Using -std=c++11 to test all c99 functions for libstdc++ configuration


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]