wiki:RFC5

Version 6 (modified by mloskot, 3 years ago) (diff)

Largish update

GEOS RFC 5: C++11 Compilation Mode

This document proposes to switch GEOS to C++11 as minimum supported version of C++ language.

RFC 5: C++11 Upgrade
Author: Mateusz Łoskot
Contact:mateusz@…
Status: Planned/Draft?

Summary

The document proposes to enable C++11 compilation mode throughout the whole C++ source code of GEOS.

The goal of the document is to request and achieve agreement on using C++11 as the minimum required version of the C++ programming language standard.

Motivation

The C++11 is the first major update of the C++ standard since 1998. (C++03 was a bug fix release.)

The C++11 features aim to promote writing clean, compact, type-safe and fast code. It also delivers better feature-wise compatibility with C language (C99).

The Wikipedia article at https://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, has been deprecated and will be removed from C++17.

The new compilers provide better diagnostics.

Enabling C++11 compilation mode will improve the programming environment making it much friendlier than C++98.

A social factor: since C++ programmers no longer enjoy C++98, allowing C++11 mode may increase potential for new contributions.

Plan

This proposal only requests agreement for the C++11 compilation mode.

This proposal does not suggest any detailed roadmap of big refactoring committed in one go.

The GEOS codebase is around 150 KLOC and given the available man-power to LOCs ratio, such one-step refactoring would not be feasible.

Instead, the task will be tackled with the baby step approach gradually transforming the codebase according to priorities set along the way. Any disruptive refactoring, changes in interfaces of C++ classes, breaking changes in C++ API must be announced and discussed on the mailing list or the bug tracker.

IMPORTANT: C++11 refactoring must not change the C API or break C API compatibility, unless agreed upon based on prior RFC proposed.

However, if the proposal is accepted, any new C++ code written for GEOS can be C++11-compliant.

Prior acceptance of this proposal is necessary in order to start any source code refactoring using C++11 features.

Once accepted, first step will be to update the build configurations to require C++11-compliant compiler.

Release

First release of C++11-enabled GEOS could be 3.7.0 or, perhaps, 4.0.0.

Compilers Landscape

Summary of compilers supported by GEOS with their minimal versions required to compile source code based on 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
Clang3.3+ C++11 status Debian 8 (stable), Ubuntu 14.04+, Fedora 19+, CentOS 6(?)
MSVC 12.0+ (2013)C++11 statusn/a

C++14

The C++14 compilers are listed for comparison only:

GCC 4.9+
Clang3.4+
MSVC 14.0+ (2015)

References