Hi,
The new C++ standard will probably be released this year [1]. I tested
with the available compilers in Debian testing (and clang 2.9 from
experimental) to see how well it compiles Wesnoth.
I tested with cmake and enabled all targets. This build uses the
--std=c++98 flag. Then I compiled again but overrode the --std=c++98
flag with --std=c++0x. Below the compilation results of a recent trunk
(after committing the recent clang fixes).
--std=c++98 --std=c++0x
g++ 4.4 success failure*
g++ 4.5 success success
g++ 4.6 success success
clang 2.9 failure** not tested
*) I didn't investigate the problems I found since newer g++ versions
compile Wesnoth properly with --std=c++0x. So I assume it's a compiler
issue.
**) The compilation fails in the gui2 tree_view code. A short
investigation on the internet found no clang issues. However I probably
will rewrite that code, so didn't investigate further. Note I used the
default clang settings and didn't set the C++ standard to be used. (I
didn't look further but assume clang uses the 98/03 version of the c++
standard as its default settings.)
The newest g++ in Debian stable is g++ 4.4, so that means that Wesnoth
can't be compiled with the flags of the upcoming C++ standard on Debian
stable. Also the g++ c++0x status page [2] shows that g++ doesn't fully
support the upcoming standard. I haven't tested the status on Windows or
Mac, since I don't have access to these platforms, but Scott Meyers has
some links regarding the c++0x status of various compilers linked on his
website [3].
Our build systems already set the default compilation mode for g++ to
--std=c++98. I propose to update our coding standards to say Wesnoth
uses c++98. When most mainstream compilers have proper c++0x support we
could evaluate whether we should move Wesnoth to c++0x.
[1]
http://herbsutter.com/2011/03/25/we-have-fdis-trip-report-march-2011-c-standards-meeting/
[2] http://gcc.gnu.org/projects/cxx0x.html
[3] http://www.aristeia.com/C++0x/C++0xFeatureAvailability.htm
--
Regards,
Mark de Wever aka Mordante/SkeletonCrew
PS I still will keep working on keeping Wesnoth compiling with g++ and
--std=c++0x, so if we decide to move the c++0x the transition should
be painless (at least for g++).
_______________________________________________
Wesnoth-dev mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-dev