Wireshark-dev: Re: [Wireshark-dev] Switch to C++11 or C++14
From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Fri, 1 Jun 2018 14:37:41 -0700
On Jun 1, 2018, at 2:21 PM, Michał Łabędzki <michal.tomasz.labedzki@xxxxxxxxx> wrote:

> Is there (still) a problem to switch to C++11 or C++14? Petri-Dish seems to support it for Windows, but there is old standard used for Ubuntu.

GCC C++ standard support:

	https://gcc.gnu.org/projects/cxx-status.html#cxx11:

		"GCC 4.8.1 was the first feature-complete implementation of the 2011 C++ standard, previously known as C++0x."

	https://gcc.gnu.org/projects/cxx-status.html#cxx14:

		"GCC has full support for the previous revision of the C++ standard, which was published in 2014.

		This mode is the default in GCC 6.1 and above; it can be explicitly selected with the -std=c++14 command-line flag, or -std=gnu++14 to enable GNU extensions as well."

		The table of C++14 features they have shows GCC 5 as the first version to support all the features in the table.


Clang C++ standard support:

	https://clang.llvm.org/cxx_status.html

		"Clang 3.3 and later implement all of the ISO C++ 2011 standard."

		"Clang 3.4 and later implement all of the ISO C++ 2014 standard."

I don't have a list of what versions of various Linux distributions, what versions of various *BSDs, and what versions of Xcode supporting what versions of macOS have which versions of GCC and/or Clang, but that would help here in determining what OS versions are required for C++11 or C++14 support.

This should perhaps go on the "support library version tracking" page, which *already* tracks things other than support libraries, such as CMake:

	https://wiki.wireshark.org/Development/Support_library_version_tracking

However, the problem with Ubuntu may be that the compiler in the version of Ubuntu running on the buildbot may be old enough that it doesn't *default* to C++11, so we may have to explicitly *ask* for C++11 in the CMake files.