This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH. libstdc++] Use the correct C++14 __cplusplus value (201402L). Added C++1z to the preprocessor.
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: Paolo Carlini <paolo dot carlini at oracle dot com>
- Cc: Ed Smith-Rowland <3dw4rd at verizon dot net>, "libstdc++\ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 26 Aug 2014 10:56:11 +0200
- Subject: Re: [PATCH. libstdc++] Use the correct C++14 __cplusplus value (201402L). Added C++1z to the preprocessor.
- Authentication-results: sourceware.org; auth=none
- References: <53F91799 dot 2070902 at verizon dot net> <53FC4524 dot 9090606 at oracle dot com> <ydda96r8wwt dot fsf at CeBiTec dot Uni-Bielefeld dot DE> <53FC4AD0 dot 9070807 at oracle dot com>
Hi Paolo,
> On 08/26/2014 10:42 AM, Rainer Orth wrote:
>> Paolo Carlini <paolo.carlini@oracle.com> writes:
>>
>>> Hi,
>>>
>>> On 08/24/2014 12:37 AM, Ed Smith-Rowland wrote:
>>>> With revision 214400 we have the C++14 value of __cplusplus set to the
>>>> correct value of 201402L (from 201300L).
>>> It occurs to me: instead of having to remember every time those numbers,
>>> couldn't we predefine, for example:
>>>
>>> __cplusplus_98
>>> __cplusplus_11
>>> __cplusplus_14
>>>
>>> with the correct values of course?!?
>> But won't this lead to portability trouble in the future when people see
>> those macros and start using them in their own code, breaking
>> compilation with older or non-g++ compilers?
> Well, this can happen for any GNU predefined macro... What can I say, I
true, but in this case they will be prominent throughout libstdc++
headers.
> tried to help ;) As a last resort we can maybe define the macros in
Greatly appreciated: they are certainly way more mnemonic than the naked
numbers ;-)
> bits/c++config...
Which won't help users seeing them in the headers. Maybe the issue
could be avoided by chosing names that make it clear that they are
g++/libstdc++ specific, not generic?
Thanks.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University