Gentoo Archives: gentoo-dev

From: Sven Eden <sven.eden@×××.de>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] How to support C++11 in libraries?
Date: Thu, 19 Dec 2013 08:58:33
Message-Id: 6224179.BWgg760IdH@sed-notebook
In Reply to: [gentoo-dev] How to support C++11 in libraries? by "Michał Górny"
1 Am Mittwoch, 18. Dezember 2013, 08:54:47 schrieb Michał Górny:
2 > This raises the following question: how do we want to do it? I see two
3 > possibilities:
4 >
5 > a) adding USE=c++11 and USE-deps to all the packages in question,
6 >
7 > b) doing the switch via synchronous version bump and matching
8 > dependencies.
9 >
10 (snip)
11 >
12 > What are your thoughts?
13
14 I have already switched to C++11 on all my projects ages ago. It offers a lot,
15 and the incompatibilities are rare at best.
16
17 C++11 is the current standard with the next being worked on already.
18 What is the rationale for staying with C++03 or (worse) C++98 in the first
19 place? Nothing is gained. Only the need to fix what becomes broken.
20
21 ( And a lot breakage can occur from using something like
22 #include <tr1/cstdint>
23 Instead of the C++11
24 #include <cstdint>
25 ... Breakages that are trivial to fix ... )
26
27 And as C++11 is stricter in many places, I consider a program failing to
28 compile with -std=c++11 to be broken and buggy per se, and needing to be fixed
29 asap anyway. (I consider any C program failing to compile with g++ broken as
30 well, allthough the cases might be more complex.)
31
32 So I'd go the reverse way. Make CXXFLAGS="-std=c++11" the default, and only
33 override this for packages that do fishy stuff and break with it.
34
35 But of course this must be tested thoroughly first. I have some extra time to
36 spare in the first three weeks of january, and I've already planned to do an
37 'emerge -e @world' with c++11 as a global default anyway.
38
39
40 Cheers
41
42 Sven

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-dev] How to support C++11 in libraries? "Michał Górny" <mgorny@g.o>