Version 3 (modified by 5 years ago) ( diff ) | ,
---|
MapGuide RFC 172 - Adopt C++11 as the minimum compiler language version
This page contains a change request (RFC) for the MapGuide Open Source project. More MapGuide RFCs can be found on the RFCs page.
Status
RFC Template Version | (1.0) |
Submission Date | 23 May 2019 |
Last Modified | 23 May 2019 |
Author | Jackie Ng |
RFC Status | draft |
Implementation Status | |
Proposed Milestone | 4.0 |
Assigned PSC guide(s) | (when determined) |
Voting History | (vote date) |
+1 | |
+0 | |
-0 | |
-1 | |
no vote |
Overview
This RFC proposes to switch to C++11 compilation mode as default throughout the whole C++ source code of MapGuide.
The goal of this RFC is to request and achieve agreement on using C++11 as the minimum required version of the C++ programming language standard.
Motivation
C++11 is the first major update of the C++ standard since 1998. (?C++03 was a bug fix release.)
Having fewer versions of C++ to support will reduce the load on developers and testing systems.
C++11 features aim to promote writing clean, compact, type-safe and fast code. It also delivers better feature-wise compatibility with the C language (C99).
The Wikipedia article at ?http://en.wikipedia.org/wiki/C++11 does a great job describing all changes in C++11 extensively.
The std::auto_ptr smart pointer, together with a bunch of other features, were deprecated and will be removed from C++17. Features like std::unique_ptr provide much stronger replacements.
Enabling C++11 compilation mode will improve the programming environment making it much friendlier than C++98.
A social factor: since (many) C++ programmers no longer enjoy C++98, allowing C++11 mode may increase potential for new contributions.
From a purely-MapGuide perspective:
- Establishing C++11 as the baseline puts us in a place to finally take advantage of some libraries which we couldn't in the past (hindering development of some new features as a result) as those libraries themselves require a C++11 compliant compiler to build.
- Also FDO implicitly now requires a C++11 compliant compiler on Linux anyways due to the removal of boost and replacing them with C++11 standard library features (eg.
std::mutex
), so it make some sense to be on the same page regarding the expected C++ standards compilation mode.
Compilers Landscape
Summary of compilers supported by MapGuide with their minimal versions required to compile source code based on
http://en.cppreference.com/w/cpp/compiler_support C++11 features.
C++11
GCC | 4.8.1+ | C++11 status | Debian 8 (stable), Ubuntu 15.04+, Ubuntu 14.04 ppa:ubuntu-toolchain-r/test , Fedora 19+, RHEL7
|
Clang | 3.3+ | C++11 status | Debian 8 (stable), Ubuntu 14.04+, Fedora 19+, CentOS 6(?) |
MSVC | 14.0+ (2015) | C++11 status | n/a |
C++14
The C++14 compilers are listed for comparison only:
GCC | 4.9+ |
Clang | 3.4+ |
MSVC | 14.0+ (2015) |
Proposed Solution
Windows: No changes required.
Linux/CMake: The CMake build will set default compiler flags to build in C++11 standards mode.
Actual porting of the MapGuide codebase to take advantage of C++11 language features and constructs is not in the scope of this RFC. This RFC is merely seeking consensus that we should now require a C++11 compliant compiler as a minimum requirement to build MapGuide.
The porting of the codebase will be an on-going activity done after adoption of this RFC.
Implications
Windows is not impacted, we will not make any compiler settings changes.
When compiling on Linux, a C++11-compliant compiler is now required.
Test Plan
Verify existing test suites still pass on Linux after activating C++11 compilation mode.
Funding / Resources
Community