Should we bump required C++ standard to c++ 17 ?

16 views
Skip to first unread message

Aliaksey Kandratsenka

unread,
Jan 27, 2024, 4:06:44 PMJan 27
to gperftools
Hi. SUBJ.

What do we get from it?

* no more optional-ness and possible troubles from aligned or sized allocation/deallocation operators. Since c++17 has them both.
* c++17 is modern enough for us to be able to use some nice helper codes from abseil or similar libraries (one I am thinking of right now is absl::FunctionRef) as well as generally keeping pace with "modern" c++

In practice we're talking gcc 8 or later. Well according to https://en.cppreference.com/w/cpp/compiler_support/17 most features were available sooner.

In terms of "enterprise" Linux distros it cuts Ubuntu LTS releases 14.04 (gcc 4.8), 16.04 (gcc 5) and potentially 18.04 (gcc 7). https://wiki.ubuntu.com/Releases states they still all have some support from Ubuntu. Users on those distros (if any; those *are* old releases), will have to find a way to get an upgraded compiler.

The case of RHEL and original Centos is covered via RedHat dev toolset stuff (my kudos to Red Hat folks doing it; super handy). I am semi-regularly testing on as far as rhel 6 and at least semi-modern compilers are available there.

I don't have data on SLES, but hopefully SuSE folks do similar or even better job than rhat folks.

Most recent Debian stable is easily good enough too. Up-to-date OSX should be covered easily. In terms of Visual Studio it'll be an upgrade of the minimal version to VS2019.

Various BSDes, well, I do know for certain that their most recent versions are definitely good enough. QNX should be covered (they ship a version of gcc 8 with their sdk).

Solaris/AIX and possibly other less commonly used cases, I have no idea (I recently tested most recent opensolaris and it fails already; I may or may not find time to get this working). But recent opensolaris at least ships up-to-date gcc. I don't have resources to test Oracle's custom compiler.

In terms of less common C++ compilers (I already mentioned Oracle's above), we're seemingly going to lose some. https://en.wikipedia.org/wiki/List_of_compilers#C++_compilers But do note that the wikipedia text explicitly states that list might be stale. Plus I do have the impression the industry appears to be consolidating towards clang.

Any concerns/comments/questions ?

Aliaksey Kandratsenka

unread,
Jan 27, 2024, 4:27:33 PMJan 27
to gperftools
Aha, I just Googled and ubuntu 14.04 has means to get c++ 17 compiler via add-apt-repository ppa:ubuntu-toolchain-r/test

It has gcc 8 and gcc 9

Aliaksey Kandratsenka

unread,
Jan 30, 2024, 4:00:40 PMJan 30
to gperftools
Hi, all. It is done. I've pushed commits to bump to c++ 17.

Happy hacking:)
Reply all
Reply to author
Forward
0 new messages