#2330 closed enhancement (invalid)
[PATCH] Enable C++11 on gcc >= 4.8 by default
Reported by: | fabio | Owned by: | |
---|---|---|---|
Priority: | Should Have | Milestone: | |
Component: | Build & Packages | Keywords: | patch |
Cc: | Patch: |
Description
The attached patch automatically enables c++11 compilation by default if gcc is >= 4.8 (no more need to manually set the configure option). Also changes the option from "-std=c++0x" to "-std=c++11", since the former is deprecated.
Attachments (1)
Change History (7)
by , 10 years ago
Attachment: | c++11.diff added |
---|
comment:1 by , 10 years ago
Summary: | [PATCH] Enable C++11on gcc >= 4.8 by default → [PATCH] Enable C++11 on gcc >= 4.8 by default |
---|
comment:2 by , 10 years ago
Keywords: | review removed |
---|---|
Milestone: | Alpha 16 |
Resolution: | → invalid |
Status: | new → closed |
follow-up: 4 comment:3 by , 10 years ago
Mhm, but you can still have incompatabilities with different compilers. Windows users can break linux compiles without knowing, gcc users can break specific msvc versions, xcode versions, etc. I think thats rather an argument for continuous integration / automatic compiles than for flags.
comment:4 by , 10 years ago
Replying to scroogie:
Mhm, but you can still have incompatabilities with different compilers. Windows users can break linux compiles without knowing, gcc users can break specific msvc versions, xcode versions, etc. I think thats rather an argument for continuous integration / automatic compiles than for flags.
Those are rarely a big deal because it's not often a dev will intentionally exploit those incompatibilities, more often it's just a mistake, but recently we've had developers committing C++11 features without even thinking about it. If it doesn't compile, that's less of a problem :) My point was rather that there's no reason to enable C++11 for anyone using 0 A.D. when we're not all on board with the new standard. Devs can still enable it experimentally for testing if they want.
comment:5 by , 10 years ago
Milestone: | → Backlog |
---|
We should use -std=c++0x for best backwards compatibility and if we enable C++11, it should be on all compilers.
comment:6 by , 10 years ago
Milestone: | Backlog |
---|
I don't think we want this, all it would do IMO is introduce the risk that people use C++11 features working on GCC 4.8+ without knowing it breaks other compilers. We should either enable C++11 for everyone or no one, but that is a rather involved discussion (see the forum topic).