Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#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)

c++11.diff (2.0 KB ) - added by fabio 10 years ago.

Download all attachments as: .zip

Change History (7)

by fabio, 10 years ago

Attachment: c++11.diff added

comment:1 by fabio, 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 historic_bruno, 10 years ago

Keywords: review removed
Milestone: Alpha 16
Resolution: invalid
Status: newclosed

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).

comment:3 by scroogie, 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.

in reply to:  3 comment:4 by historic_bruno, 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 Josh, 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 Josh, 10 years ago

Milestone: Backlog
Note: See TracTickets for help on using tickets.