View Issue Details

IDProjectCategoryView StatusLast Update
0001183OpenMPTGeneralpublic2019-09-05 15:21
Reportermanx Assigned Tomanx  
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Product VersionOpenMPT 1.29.00.* (old testing) 
Target VersionOpenMPT 1.29.01.00 / libopenmpt 0.5.0 (upgrade first)Fixed in VersionOpenMPT 1.29.01.00 / libopenmpt 0.5.0 (upgrade first) 
Summary0001183: require C++14
Description

Requiring C++14 would remove most ancient compilers for which we currently implement work-arounds due to incomplete standard library implementations.

Additionally, C++14 gives us in particular actually useful constexpr support.

Would remove at least the following compiler versions:

  • MSVC 2015
  • GCC 4.8
  • GCC 4.9
  • Clang 3.6
  • Clang 3.7

and maybe also:

  • GCC 5

current distro compilers:

  • Debian 10 (current stable) is at GCC 8.
  • Ubuntu 18.04 LTS is at GCC 7.
  • FreeBSD 11.2 and 12.0 are both at Clang 6.

If required or useful in some context, we might even drop Clang up to 5.0 or something like that.

TagsNo tags attached.
Attached Files
require-cpp14-v2.patch (15,135 bytes)   
Index: Makefile
===================================================================
--- Makefile	(revision 11150)
+++ Makefile	(working copy)
@@ -54,7 +54,7 @@
 #  ONLY_TEST=0      Only build the test suite.
 #  STRICT=0         Treat warnings as errors.
 #  MODERN=0         Pass more modern compiler options.
-#  STDCXX=c++11     C++ standard version (only for GCC and clang)
+#  STDCXX=c++14     C++ standard version (only for GCC and clang)
 #  CHECKED=0        Enable run-time assertions.
 #  CHECKED_ADDRESS=0   Enable address sanitizer
 #  CHECKED_UNDEFINED=0 Enable undefined behaviour sanitizer
@@ -629,7 +629,7 @@
 endif
 
 CPPCHECK_FLAGS += -j $(NUMTHREADS)
-CPPCHECK_FLAGS += --std=c99 --std=c++11
+CPPCHECK_FLAGS += --std=c99 --std=c++14
 CPPCHECK_FLAGS += --quiet
 CPPCHECK_FLAGS += --enable=warning --inline-suppr --template='{file}:{line}: warning: {severity}: {message} [{id}]'
 CPPCHECK_FLAGS += --suppress=missingIncludeSystem
Index: build/autotools/configure.ac
===================================================================
--- build/autotools/configure.ac	(revision 11150)
+++ build/autotools/configure.ac	(working copy)
@@ -288,16 +288,11 @@
 AC_PROG_CC_STDC
 #AC_PROG_CC_C99
 
-# We need C++11 support
+# We need C++14 support
 AX_CXX_COMPILE_STDCXX(17, [noext], [optional])
 AS_IF([test "x$HAVE_CXX17" != "x1"],
  [
-  AX_CXX_COMPILE_STDCXX(14, [noext], [optional])
-  AS_IF([test "x$HAVE_CXX14" != "x1"],
-   [
-    AX_CXX_COMPILE_STDCXX(11, [noext], [mandatory])
-   ],[]
-  )
+  AX_CXX_COMPILE_STDCXX(14, [noext], [mandatory])
  ],[]
 )
 
Index: build/make/config-afl.mk
===================================================================
--- build/make/config-afl.mk	(revision 11150)
+++ build/make/config-afl.mk	(working copy)
@@ -12,13 +12,9 @@
 else
 ifeq ($(shell printf '\n' > bin/empty.cpp ; if $(CXX) -std=c++14 -c bin/empty.cpp -o bin/empty.out > /dev/null 2>&1 ; then echo 'c++14' ; fi ), c++14)
 CXXFLAGS_STDCXX = -std=c++14
-else
-ifeq ($(shell printf '\n' > bin/empty.cpp ; if $(CXX) -std=c++11 -c bin/empty.cpp -o bin/empty.out > /dev/null 2>&1 ; then echo 'c++11' ; fi ), c++11)
-CXXFLAGS_STDCXX = -std=c++11
 endif
 endif
 endif
-endif
 CFLAGS_STDC = -std=c99
 CXXFLAGS += $(CXXFLAGS_STDCXX)
 CFLAGS += $(CFLAGS_STDC)
Index: build/make/config-clang.mk
===================================================================
--- build/make/config-clang.mk	(revision 11150)
+++ build/make/config-clang.mk	(working copy)
@@ -12,13 +12,9 @@
 else
 ifeq ($(shell printf '\n' > bin/empty.cpp ; if $(CXX) -std=c++14 -c bin/empty.cpp -o bin/empty.out > /dev/null 2>&1 ; then echo 'c++14' ; fi ), c++14)
 CXXFLAGS_STDCXX = -std=c++14
-else
-ifeq ($(shell printf '\n' > bin/empty.cpp ; if $(CXX) -std=c++11 -c bin/empty.cpp -o bin/empty.out > /dev/null 2>&1 ; then echo 'c++11' ; fi ), c++11)
-CXXFLAGS_STDCXX = -std=c++11
 endif
 endif
 endif
-endif
 CFLAGS_STDC = -std=c99
 CXXFLAGS += $(CXXFLAGS_STDCXX)
 CFLAGS += $(CFLAGS_STDC)
Index: build/make/config-djgpp.mk
===================================================================
--- build/make/config-djgpp.mk	(revision 11150)
+++ build/make/config-djgpp.mk	(working copy)
@@ -6,7 +6,7 @@
 
 # Note that we are using GNU extensions instead of 100% standards-compliant
 # mode, because otherwise DJGPP-specific headers/functions are unavailable.
-CXXFLAGS_STDCXX = -std=gnu++11
+CXXFLAGS_STDCXX = -std=gnu++14
 CFLAGS_STDC = -std=gnu99
 CXXFLAGS += $(CXXFLAGS_STDCXX)
 CFLAGS += $(CFLAGS_STDC)
Index: build/make/config-emscripten.mk
===================================================================
--- build/make/config-emscripten.mk	(revision 11150)
+++ build/make/config-emscripten.mk	(working copy)
@@ -14,13 +14,9 @@
 else
 ifeq ($(shell printf '\n' > bin/empty.cpp ; if $(CXX) -std=c++14 -c bin/empty.cpp -o bin/empty.out > /dev/null 2>&1 ; then echo 'c++14' ; fi ), c++14)
 CXXFLAGS_STDCXX = -std=c++14
-else
-ifeq ($(shell printf '\n' > bin/empty.cpp ; if $(CXX) -std=c++11 -c bin/empty.cpp -o bin/empty.out > /dev/null 2>&1 ; then echo 'c++11' ; fi ), c++11)
-CXXFLAGS_STDCXX = -std=c++11
 endif
 endif
 endif
-endif
 CFLAGS_STDC = -std=c99
 CXXFLAGS += $(CXXFLAGS_STDCXX)
 CFLAGS += $(CFLAGS_STDC)
Index: build/make/config-gcc.mk
===================================================================
--- build/make/config-gcc.mk	(revision 11150)
+++ build/make/config-gcc.mk	(working copy)
@@ -12,13 +12,9 @@
 else
 ifeq ($(shell printf '\n' > bin/empty.cpp ; if $(CXX) -std=c++14 -c bin/empty.cpp -o bin/empty.out > /dev/null 2>&1 ; then echo 'c++14' ; fi ), c++14)
 CXXFLAGS_STDCXX = -std=c++14
-else
-ifeq ($(shell printf '\n' > bin/empty.cpp ; if $(CXX) -std=c++11 -c bin/empty.cpp -o bin/empty.out > /dev/null 2>&1 ; then echo 'c++11' ; fi ), c++11)
-CXXFLAGS_STDCXX = -std=c++11
 endif
 endif
 endif
-endif
 CFLAGS_STDC = -std=c99
 CXXFLAGS += $(CXXFLAGS_STDCXX)
 CFLAGS += $(CFLAGS_STDC)
Index: build/make/config-generic.mk
===================================================================
--- build/make/config-generic.mk	(revision 11150)
+++ build/make/config-generic.mk	(working copy)
@@ -4,7 +4,7 @@
 LD  ?= c++
 AR  = ar
 
-CXXFLAGS_STDCXX = -std=c++11
+CXXFLAGS_STDCXX = -std=c++14
 CFLAGS_STDC = -std=c99
 CXXFLAGS += $(CXXFLAGS_STDCXX)
 CFLAGS += $(CFLAGS_STDC)
Index: build/make/config-mingw64-win32.mk
===================================================================
--- build/make/config-mingw64-win32.mk	(revision 11150)
+++ build/make/config-mingw64-win32.mk	(working copy)
@@ -4,7 +4,7 @@
 LD  = i686-w64-mingw32-g++$(MINGW_FLAVOUR)
 AR  = i686-w64-mingw32-ar$(MINGW_FLAVOUR)
 
-CXXFLAGS_STDCXX = -std=c++11
+CXXFLAGS_STDCXX = -std=c++14
 CFLAGS_STDC = -std=c99
 CXXFLAGS += $(CXXFLAGS_STDCXX)
 CFLAGS += $(CFLAGS_STDC)
Index: build/make/config-mingw64-win64.mk
===================================================================
--- build/make/config-mingw64-win64.mk	(revision 11150)
+++ build/make/config-mingw64-win64.mk	(working copy)
@@ -4,7 +4,7 @@
 LD  = x86_64-w64-mingw32-g++$(MINGW_FLAVOUR)
 AR  = x86_64-w64-mingw32-ar$(MINGW_FLAVOUR)
 
-CXXFLAGS_STDCXX = -std=c++11
+CXXFLAGS_STDCXX = -std=c++14
 CFLAGS_STDC = -std=c99
 CXXFLAGS += $(CXXFLAGS_STDCXX)
 CFLAGS += $(CFLAGS_STDC)
Index: build/make/config-mingw64-winrt-amd64.mk
===================================================================
--- build/make/config-mingw64-winrt-amd64.mk	(revision 11150)
+++ build/make/config-mingw64-winrt-amd64.mk	(working copy)
@@ -4,7 +4,7 @@
 LD  = x86_64-w64-mingw32-g++$(MINGW_FLAVOUR)
 AR  = x86_64-w64-mingw32-ar$(MINGW_FLAVOUR)
 
-CXXFLAGS_STDCXX = -std=c++11
+CXXFLAGS_STDCXX = -std=c++14
 CFLAGS_STDC = -std=c99
 CXXFLAGS += $(CXXFLAGS_STDCXX)
 CFLAGS += $(CFLAGS_STDC)
Index: build/make/config-mingw64-winrt-x86.mk
===================================================================
--- build/make/config-mingw64-winrt-x86.mk	(revision 11150)
+++ build/make/config-mingw64-winrt-x86.mk	(working copy)
@@ -4,7 +4,7 @@
 LD  = i686-w64-mingw32-g++$(MINGW_FLAVOUR)
 AR  = i686-w64-mingw32-ar$(MINGW_FLAVOUR)
 
-CXXFLAGS_STDCXX = -std=c++11
+CXXFLAGS_STDCXX = -std=c++14
 CFLAGS_STDC = -std=c99
 CXXFLAGS += $(CXXFLAGS_STDCXX)
 CFLAGS += $(CFLAGS_STDC)
Index: build/make/config-standard.mk
===================================================================
--- build/make/config-standard.mk	(revision 11150)
+++ build/make/config-standard.mk	(working copy)
@@ -4,7 +4,7 @@
 LD  ?= c++
 AR  = ar
 
-CXXFLAGS_STDCXX = -std=c++11
+CXXFLAGS_STDCXX = -std=c++14
 CFLAGS_STDC = -std=c99
 CXXFLAGS += $(CXXFLAGS_STDCXX)
 CFLAGS += $(CFLAGS_STDC)
Index: common/CompilerDetect.h
===================================================================
--- common/CompilerDetect.h	(revision 11150)
+++ common/CompilerDetect.h	(working copy)
@@ -51,8 +51,8 @@
 #define MPT_GCC_AT_LEAST(major,minor,patch)          (MPT_COMPILER_GCC_VERSION >= MPT_COMPILER_MAKE_VERSION3((major),(minor),(patch)))
 #define MPT_GCC_BEFORE(major,minor,patch)            (MPT_COMPILER_GCC_VERSION <  MPT_COMPILER_MAKE_VERSION3((major),(minor),(patch)))
 
-#if MPT_GCC_BEFORE(4,8,0)
-#error "GCC version 4.8 required"
+#if MPT_GCC_BEFORE(5,1,0)
+#error "GCC version 5.1 required"
 #endif
 
 #elif defined(_MSC_VER)
@@ -136,7 +136,7 @@
 #elif (__cplusplus >= 201402)
 #define MPT_CXX 14
 #else
-#define MPT_CXX 11
+#define MPT_CXX 14
 #endif
 
 #elif MPT_COMPILER_MSVC
@@ -147,15 +147,15 @@
 #elif (_MSVC_LANG >= 201402)
 #define MPT_CXX 14
 #else
-#define MPT_CXX 11
+#define MPT_CXX 14
 #endif
 #else
-#define MPT_CXX 11
+#define MPT_CXX 14
 #endif
 
 #else
 
-#define MPT_CXX 11
+#define MPT_CXX 14
 
 #endif
 
Index: common/Endianness.h
===================================================================
--- common/Endianness.h	(revision 11150)
+++ common/Endianness.h	(working copy)
@@ -85,7 +85,7 @@
 
 
 
-#if MPT_PLATFORM_ENDIAN_KNOWN && MPT_CXX_AT_LEAST(14)
+#if MPT_PLATFORM_ENDIAN_KNOWN
 //#define MPT_ENDIAN_IS_CONSTEXPR 1
 // For now, we do not want to use constexpr endianness functions and types.
 // It bloats the binary size somewhat (possibly because of either the zeroing
Index: common/mptAlloc.h
===================================================================
--- common/mptAlloc.h	(revision 11150)
+++ common/mptAlloc.h	(working copy)
@@ -79,19 +79,9 @@
 
 
 
-#if MPT_CXX_AT_LEAST(14)
 namespace mpt {
 using std::make_unique;
 } // namespace mpt
-#else
-namespace mpt {
-template<typename T, typename... Args>
-std::unique_ptr<T> make_unique(Args&&... args)
-{
-	return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
-}
-} // namespace mpt
-#endif
 
 
 
Index: common/mptBaseTypes.h
===================================================================
--- common/mptBaseTypes.h	(revision 11150)
+++ common/mptBaseTypes.h	(working copy)
@@ -22,9 +22,6 @@
 #include <cstddef>
 #include <cstdint>
 
-#if MPT_GCC_BEFORE(4,9,0)
-#include <stddef.h>
-#endif
 #include <stdint.h>
 
 
@@ -91,11 +88,7 @@
 
 
 namespace mpt {
-#if MPT_GCC_BEFORE(4,9,0)
-typedef ::max_align_t max_align_t;
-#else
 typedef std::max_align_t max_align_t;
-#endif
 } // namespace mpt
 
 
Index: common/mptMemory.h
===================================================================
--- common/mptMemory.h	(revision 11150)
+++ common/mptMemory.h	(working copy)
@@ -132,7 +132,7 @@
 inline void MemsetZero(T &a)
 {
 	static_assert(std::is_pointer<T>::value == false, "Won't memset pointers.");
-#if MPT_GCC_BEFORE(5,1,0) || (MPT_COMPILER_CLANG && defined(__GLIBCXX__))
+#if MPT_COMPILER_CLANG && defined(__GLIBCXX__)
 	MPT_STATIC_ASSERT(std::is_standard_layout<T>::value);
 	MPT_STATIC_ASSERT(std::is_trivial<T>::value || mpt::is_binary_safe<T>::value); // approximation
 #else // default
@@ -158,7 +158,7 @@
 MPT_FORCEINLINE Tdst bit_cast(const Tsrc & src) noexcept
 {
 	MPT_STATIC_ASSERT(sizeof(Tdst) == sizeof(Tsrc));
-#if MPT_GCC_BEFORE(5,1,0) || (MPT_COMPILER_CLANG && defined(__GLIBCXX__))
+#if MPT_COMPILER_CLANG && defined(__GLIBCXX__)
 	MPT_STATIC_ASSERT(std::is_trivial<Tdst>::value); // approximation
 	MPT_STATIC_ASSERT(std::is_trivial<Tsrc>::value); // approximation
 #else // default
Index: libopenmpt/dox/changelog.md
===================================================================
--- libopenmpt/dox/changelog.md	(revision 11150)
+++ libopenmpt/dox/changelog.md	(working copy)
@@ -7,6 +7,9 @@
 
 ### libopenmpt 0.5.0-pre
 
+ *  [**Regression**] Support for C++11 has been removed. C++14 is now required.
+ *  [**Regression**] Support for GCC 4.8, 4.9 has been removed.
+
 ### libopenmpt 0.4.0
 
  *  [**New**] libopenmpt now includes emulation of the OPL chip and thus plays
Index: libopenmpt/dox/dependencies.md
===================================================================
--- libopenmpt/dox/dependencies.md	(revision 11150)
+++ libopenmpt/dox/dependencies.md	(working copy)
@@ -11,15 +11,15 @@
  *  Supported compilers for building libopenmpt:
      *  **Microsoft Visual Studio 2015** or higher, running on a x86-64 build
         system (other target systems are supported)
-     *  **GCC 4.8** or higher
+     *  **GCC 5.1** or higher
      *  **Clang 3.6** or higher
-     *  **MinGW-W64 4.8** or higher (it is recommended to preferably use
+     *  **MinGW-W64 5.1** or higher (it is recommended to preferably use
         posix threading model as opposed to win32 threading model, or at least
         have mingw-std-threads available otherwise)
      *  **emscripten 1.38.5** or higher
      *  **DJGPP GCC 7.2** or higher
-     *  any other **C++11 compliant** compiler (full standard compliant mode is
-        known to work with GCC >= 5.1 and Clang)
+     *  any other **C++14 compliant** compiler (full standard compliant mode is
+        known to work with GCC >= 5.1 and Clang >= 3.6)
         
         libopenmpt makes the following assumptions about the C++ implementation
         used for building:
@@ -75,11 +75,11 @@
  *  Supported compilers for building openmpt123:
      *  **Microsoft Visual Studio 2015** or higher, running on a x86-64 build
         system (other target systems are supported)
-     *  **GCC 4.8** or higher
+     *  **GCC 5.1** or higher
      *  **Clang 3.6** or higher
-     *  **MinGW-W64 4.8** or higher
+     *  **MinGW-W64 5.1** or higher
      *  **DJGPP GCC 7.2** or higher
-     *  any **C++11 compliant** compiler
+     *  any **C++14 compliant** compiler
  *  Live sound output requires one of:
      *  **PulseAudio**
      *  **SDL 2**
Index: libopenmpt/dox/quickstart.md
===================================================================
--- libopenmpt/dox/quickstart.md	(revision 11150)
+++ libopenmpt/dox/quickstart.md	(working copy)
@@ -7,7 +7,7 @@
 
  1. Grab a `libopenmpt-VERSION.autotools.tar.gz` tarball.
  2. Get dependencies:
-     -  **gcc >= 4.8** or **clang >= 3.6**
+     -  **gcc >= 5.1** or **clang >= 3.6**
      -  **pkg-config >= 0.24**
      -  **zlib**
      -  **libogg**, **libvorbis**, **libvorbisfile**
@@ -42,7 +42,7 @@
 
  1. Get dependencies:
      -  **GNU make**
-     -  **gcc >= 4.8** or **clang >= 3.6**
+     -  **gcc >= 5.1** or **clang >= 3.6**
      -  **pkg-config**
      -  **zlib**
      -  **libogg**, **libvorbis**, **libvorbisfile**
Index: libopenmpt/libopenmpt_version.h
===================================================================
--- libopenmpt/libopenmpt_version.h	(revision 11150)
+++ libopenmpt/libopenmpt_version.h	(working copy)
@@ -21,7 +21,7 @@
 /*! \brief libopenmpt patch version number */
 #define OPENMPT_API_VERSION_PATCH 0
 /*! \brief libopenmpt pre-release tag */
-#define OPENMPT_API_VERSION_PREREL "-pre.1"
+#define OPENMPT_API_VERSION_PREREL "-pre.2"
 /*! \brief libopenmpt pre-release flag */
 #define OPENMPT_API_VERSION_IS_PREREL 1
 
Index: libopenmpt/libopenmpt_version.mk
===================================================================
--- libopenmpt/libopenmpt_version.mk	(revision 11150)
+++ libopenmpt/libopenmpt_version.mk	(working copy)
@@ -1,7 +1,7 @@
 LIBOPENMPT_VERSION_MAJOR=0
 LIBOPENMPT_VERSION_MINOR=5
 LIBOPENMPT_VERSION_PATCH=0
-LIBOPENMPT_VERSION_PREREL=-pre.1
+LIBOPENMPT_VERSION_PREREL=-pre.2
 
 LIBOPENMPT_LTVER_CURRENT=2
 LIBOPENMPT_LTVER_REVISION=0
require-cpp14-v2.patch (15,135 bytes)   
remove-vs2015-v2.zip (292,246 bytes)
remove-vs2015-v3.zip (292,418 bytes)
Has the bug occurred in previous versions?
Tested code revision (in case you know it)

Relationships

related to 0000836 resolvedmanx Remove support for C++98 and C++03 compilers 
related to 0000846 resolvedmanx Enable C++11 support on Android 
related to 0001098 resolvedmanx Remove suppot for Clang 3.4 and Clang 3.5 
related to 0001185 resolvedmanx Restructure MSVC bin directory layout 
related to 0001256 resolvedmanx require C++17 

Activities

manx

manx

2018-12-31 08:34

administrator   ~0003786

v1 removes GCC before 5.1, and all C++11 support from Makefile and Autotools build systems.

The bigger change will be removal of MSVC 2015 and all MPT_CONSTEXPR macros.

require-cpp14-v1.patch (13,666 bytes)   
Index: Makefile
===================================================================
--- Makefile	(revision 11131)
+++ Makefile	(working copy)
@@ -54,7 +54,7 @@
 #  ONLY_TEST=0      Only build the test suite.
 #  STRICT=0         Treat warnings as errors.
 #  MODERN=0         Pass more modern compiler options.
-#  STDCXX=c++11     C++ standard version (only for GCC and clang)
+#  STDCXX=c++14     C++ standard version (only for GCC and clang)
 #  CHECKED=0        Enable run-time assertions.
 #  CHECKED_ADDRESS=0   Enable address sanitizer
 #  CHECKED_UNDEFINED=0 Enable undefined behaviour sanitizer
@@ -629,7 +629,7 @@
 endif
 
 CPPCHECK_FLAGS += -j $(NUMTHREADS)
-CPPCHECK_FLAGS += --std=c99 --std=c++11
+CPPCHECK_FLAGS += --std=c99 --std=c++14
 CPPCHECK_FLAGS += --quiet
 CPPCHECK_FLAGS += --enable=warning --inline-suppr --template='{file}:{line}: warning: {severity}: {message} [{id}]'
 CPPCHECK_FLAGS += --suppress=missingIncludeSystem
Index: build/autotools/configure.ac
===================================================================
--- build/autotools/configure.ac	(revision 11131)
+++ build/autotools/configure.ac	(working copy)
@@ -288,16 +288,11 @@
 AC_PROG_CC_STDC
 #AC_PROG_CC_C99
 
-# We need C++11 support
+# We need C++14 support
 AX_CXX_COMPILE_STDCXX(17, [noext], [optional])
 AS_IF([test "x$HAVE_CXX17" != "x1"],
  [
-  AX_CXX_COMPILE_STDCXX(14, [noext], [optional])
-  AS_IF([test "x$HAVE_CXX14" != "x1"],
-   [
-    AX_CXX_COMPILE_STDCXX(11, [noext], [mandatory])
-   ],[]
-  )
+  AX_CXX_COMPILE_STDCXX(14, [noext], [mandatory])
  ],[]
 )
 
Index: build/make/config-afl.mk
===================================================================
--- build/make/config-afl.mk	(revision 11131)
+++ build/make/config-afl.mk	(working copy)
@@ -12,13 +12,9 @@
 else
 ifeq ($(shell printf '\n' > bin/empty.cpp ; if $(CXX) -std=c++14 -c bin/empty.cpp -o bin/empty.out > /dev/null 2>&1 ; then echo 'c++14' ; fi ), c++14)
 CXXFLAGS_STDCXX = -std=c++14
-else
-ifeq ($(shell printf '\n' > bin/empty.cpp ; if $(CXX) -std=c++11 -c bin/empty.cpp -o bin/empty.out > /dev/null 2>&1 ; then echo 'c++11' ; fi ), c++11)
-CXXFLAGS_STDCXX = -std=c++11
 endif
 endif
 endif
-endif
 CFLAGS_STDC = -std=c99
 CXXFLAGS += $(CXXFLAGS_STDCXX)
 CFLAGS += $(CFLAGS_STDC)
Index: build/make/config-clang.mk
===================================================================
--- build/make/config-clang.mk	(revision 11131)
+++ build/make/config-clang.mk	(working copy)
@@ -12,13 +12,9 @@
 else
 ifeq ($(shell printf '\n' > bin/empty.cpp ; if $(CXX) -std=c++14 -c bin/empty.cpp -o bin/empty.out > /dev/null 2>&1 ; then echo 'c++14' ; fi ), c++14)
 CXXFLAGS_STDCXX = -std=c++14
-else
-ifeq ($(shell printf '\n' > bin/empty.cpp ; if $(CXX) -std=c++11 -c bin/empty.cpp -o bin/empty.out > /dev/null 2>&1 ; then echo 'c++11' ; fi ), c++11)
-CXXFLAGS_STDCXX = -std=c++11
 endif
 endif
 endif
-endif
 CFLAGS_STDC = -std=c99
 CXXFLAGS += $(CXXFLAGS_STDCXX)
 CFLAGS += $(CFLAGS_STDC)
Index: build/make/config-djgpp.mk
===================================================================
--- build/make/config-djgpp.mk	(revision 11131)
+++ build/make/config-djgpp.mk	(working copy)
@@ -6,7 +6,7 @@
 
 # Note that we are using GNU extensions instead of 100% standards-compliant
 # mode, because otherwise DJGPP-specific headers/functions are unavailable.
-CXXFLAGS_STDCXX = -std=gnu++11
+CXXFLAGS_STDCXX = -std=gnu++14
 CFLAGS_STDC = -std=gnu99
 CXXFLAGS += $(CXXFLAGS_STDCXX)
 CFLAGS += $(CFLAGS_STDC)
Index: build/make/config-emscripten.mk
===================================================================
--- build/make/config-emscripten.mk	(revision 11131)
+++ build/make/config-emscripten.mk	(working copy)
@@ -14,13 +14,9 @@
 else
 ifeq ($(shell printf '\n' > bin/empty.cpp ; if $(CXX) -std=c++14 -c bin/empty.cpp -o bin/empty.out > /dev/null 2>&1 ; then echo 'c++14' ; fi ), c++14)
 CXXFLAGS_STDCXX = -std=c++14
-else
-ifeq ($(shell printf '\n' > bin/empty.cpp ; if $(CXX) -std=c++11 -c bin/empty.cpp -o bin/empty.out > /dev/null 2>&1 ; then echo 'c++11' ; fi ), c++11)
-CXXFLAGS_STDCXX = -std=c++11
 endif
 endif
 endif
-endif
 CFLAGS_STDC = -std=c99
 CXXFLAGS += $(CXXFLAGS_STDCXX)
 CFLAGS += $(CFLAGS_STDC)
Index: build/make/config-gcc.mk
===================================================================
--- build/make/config-gcc.mk	(revision 11131)
+++ build/make/config-gcc.mk	(working copy)
@@ -12,13 +12,9 @@
 else
 ifeq ($(shell printf '\n' > bin/empty.cpp ; if $(CXX) -std=c++14 -c bin/empty.cpp -o bin/empty.out > /dev/null 2>&1 ; then echo 'c++14' ; fi ), c++14)
 CXXFLAGS_STDCXX = -std=c++14
-else
-ifeq ($(shell printf '\n' > bin/empty.cpp ; if $(CXX) -std=c++11 -c bin/empty.cpp -o bin/empty.out > /dev/null 2>&1 ; then echo 'c++11' ; fi ), c++11)
-CXXFLAGS_STDCXX = -std=c++11
 endif
 endif
 endif
-endif
 CFLAGS_STDC = -std=c99
 CXXFLAGS += $(CXXFLAGS_STDCXX)
 CFLAGS += $(CFLAGS_STDC)
Index: build/make/config-generic.mk
===================================================================
--- build/make/config-generic.mk	(revision 11131)
+++ build/make/config-generic.mk	(working copy)
@@ -4,7 +4,7 @@
 LD  ?= c++
 AR  = ar
 
-CXXFLAGS_STDCXX = -std=c++11
+CXXFLAGS_STDCXX = -std=c++14
 CFLAGS_STDC = -std=c99
 CXXFLAGS += $(CXXFLAGS_STDCXX)
 CFLAGS += $(CFLAGS_STDC)
Index: build/make/config-mingw64-win32.mk
===================================================================
--- build/make/config-mingw64-win32.mk	(revision 11131)
+++ build/make/config-mingw64-win32.mk	(working copy)
@@ -4,7 +4,7 @@
 LD  = i686-w64-mingw32-g++$(MINGW_FLAVOUR)
 AR  = i686-w64-mingw32-ar$(MINGW_FLAVOUR)
 
-CXXFLAGS_STDCXX = -std=c++11
+CXXFLAGS_STDCXX = -std=c++14
 CFLAGS_STDC = -std=c99
 CXXFLAGS += $(CXXFLAGS_STDCXX)
 CFLAGS += $(CFLAGS_STDC)
Index: build/make/config-mingw64-win64.mk
===================================================================
--- build/make/config-mingw64-win64.mk	(revision 11131)
+++ build/make/config-mingw64-win64.mk	(working copy)
@@ -4,7 +4,7 @@
 LD  = x86_64-w64-mingw32-g++$(MINGW_FLAVOUR)
 AR  = x86_64-w64-mingw32-ar$(MINGW_FLAVOUR)
 
-CXXFLAGS_STDCXX = -std=c++11
+CXXFLAGS_STDCXX = -std=c++14
 CFLAGS_STDC = -std=c99
 CXXFLAGS += $(CXXFLAGS_STDCXX)
 CFLAGS += $(CFLAGS_STDC)
Index: build/make/config-mingw64-winrt-amd64.mk
===================================================================
--- build/make/config-mingw64-winrt-amd64.mk	(revision 11131)
+++ build/make/config-mingw64-winrt-amd64.mk	(working copy)
@@ -4,7 +4,7 @@
 LD  = x86_64-w64-mingw32-g++$(MINGW_FLAVOUR)
 AR  = x86_64-w64-mingw32-ar$(MINGW_FLAVOUR)
 
-CXXFLAGS_STDCXX = -std=c++11
+CXXFLAGS_STDCXX = -std=c++14
 CFLAGS_STDC = -std=c99
 CXXFLAGS += $(CXXFLAGS_STDCXX)
 CFLAGS += $(CFLAGS_STDC)
Index: build/make/config-mingw64-winrt-x86.mk
===================================================================
--- build/make/config-mingw64-winrt-x86.mk	(revision 11131)
+++ build/make/config-mingw64-winrt-x86.mk	(working copy)
@@ -4,7 +4,7 @@
 LD  = i686-w64-mingw32-g++$(MINGW_FLAVOUR)
 AR  = i686-w64-mingw32-ar$(MINGW_FLAVOUR)
 
-CXXFLAGS_STDCXX = -std=c++11
+CXXFLAGS_STDCXX = -std=c++14
 CFLAGS_STDC = -std=c99
 CXXFLAGS += $(CXXFLAGS_STDCXX)
 CFLAGS += $(CFLAGS_STDC)
Index: build/make/config-standard.mk
===================================================================
--- build/make/config-standard.mk	(revision 11131)
+++ build/make/config-standard.mk	(working copy)
@@ -4,7 +4,7 @@
 LD  ?= c++
 AR  = ar
 
-CXXFLAGS_STDCXX = -std=c++11
+CXXFLAGS_STDCXX = -std=c++14
 CFLAGS_STDC = -std=c99
 CXXFLAGS += $(CXXFLAGS_STDCXX)
 CFLAGS += $(CFLAGS_STDC)
Index: common/CompilerDetect.h
===================================================================
--- common/CompilerDetect.h	(revision 11131)
+++ common/CompilerDetect.h	(working copy)
@@ -51,8 +51,8 @@
 #define MPT_GCC_AT_LEAST(major,minor,patch)          (MPT_COMPILER_GCC_VERSION >= MPT_COMPILER_MAKE_VERSION3((major),(minor),(patch)))
 #define MPT_GCC_BEFORE(major,minor,patch)            (MPT_COMPILER_GCC_VERSION <  MPT_COMPILER_MAKE_VERSION3((major),(minor),(patch)))
 
-#if MPT_GCC_BEFORE(4,8,0)
-#error "GCC version 4.8 required"
+#if MPT_GCC_BEFORE(5,1,0)
+#error "GCC version 5.1 required"
 #endif
 
 #elif defined(_MSC_VER)
@@ -136,7 +136,7 @@
 #elif (__cplusplus >= 201402)
 #define MPT_CXX 14
 #else
-#define MPT_CXX 11
+#define MPT_CXX 14
 #endif
 
 #elif MPT_COMPILER_MSVC
@@ -147,15 +147,15 @@
 #elif (_MSVC_LANG >= 201402)
 #define MPT_CXX 14
 #else
-#define MPT_CXX 11
+#define MPT_CXX 14
 #endif
 #else
-#define MPT_CXX 11
+#define MPT_CXX 14
 #endif
 
 #else
 
-#define MPT_CXX 11
+#define MPT_CXX 14
 
 #endif
 
Index: common/Endianness.h
===================================================================
--- common/Endianness.h	(revision 11131)
+++ common/Endianness.h	(working copy)
@@ -85,7 +85,7 @@
 
 
 
-#if MPT_PLATFORM_ENDIAN_KNOWN && MPT_CXX_AT_LEAST(14)
+#if MPT_PLATFORM_ENDIAN_KNOWN
 //#define MPT_ENDIAN_IS_CONSTEXPR 1
 // For now, we do not want to use constexpr endianness functions and types.
 // It bloats the binary size somewhat (possibly because of either the zeroing
Index: common/mptAlloc.h
===================================================================
--- common/mptAlloc.h	(revision 11131)
+++ common/mptAlloc.h	(working copy)
@@ -79,19 +79,9 @@
 
 
 
-#if MPT_CXX_AT_LEAST(14)
 namespace mpt {
 using std::make_unique;
 } // namespace mpt
-#else
-namespace mpt {
-template<typename T, typename... Args>
-std::unique_ptr<T> make_unique(Args&&... args)
-{
-	return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
-}
-} // namespace mpt
-#endif
 
 
 
Index: common/mptBaseTypes.h
===================================================================
--- common/mptBaseTypes.h	(revision 11131)
+++ common/mptBaseTypes.h	(working copy)
@@ -22,9 +22,6 @@
 #include <cstddef>
 #include <cstdint>
 
-#if MPT_GCC_BEFORE(4,9,0)
-#include <stddef.h>
-#endif
 #include <stdint.h>
 
 
@@ -91,11 +88,7 @@
 
 
 namespace mpt {
-#if MPT_GCC_BEFORE(4,9,0)
-typedef ::max_align_t max_align_t;
-#else
 typedef std::max_align_t max_align_t;
-#endif
 } // namespace mpt
 
 
Index: common/mptMemory.h
===================================================================
--- common/mptMemory.h	(revision 11131)
+++ common/mptMemory.h	(working copy)
@@ -132,7 +132,7 @@
 inline void MemsetZero(T &a)
 {
 	static_assert(std::is_pointer<T>::value == false, "Won't memset pointers.");
-#if MPT_GCC_BEFORE(5,1,0) || (MPT_COMPILER_CLANG && defined(__GLIBCXX__))
+#if MPT_COMPILER_CLANG && defined(__GLIBCXX__)
 	MPT_STATIC_ASSERT(std::is_standard_layout<T>::value);
 	MPT_STATIC_ASSERT(std::is_trivial<T>::value || mpt::is_binary_safe<T>::value); // approximation
 #else // default
@@ -158,7 +158,7 @@
 MPT_FORCEINLINE Tdst bit_cast(const Tsrc & src) noexcept
 {
 	MPT_STATIC_ASSERT(sizeof(Tdst) == sizeof(Tsrc));
-#if MPT_GCC_BEFORE(5,1,0) || (MPT_COMPILER_CLANG && defined(__GLIBCXX__))
+#if MPT_COMPILER_CLANG && defined(__GLIBCXX__)
 	MPT_STATIC_ASSERT(std::is_trivial<Tdst>::value); // approximation
 	MPT_STATIC_ASSERT(std::is_trivial<Tsrc>::value); // approximation
 #else // default
Index: libopenmpt/dox/dependencies.md
===================================================================
--- libopenmpt/dox/dependencies.md	(revision 11131)
+++ libopenmpt/dox/dependencies.md	(working copy)
@@ -11,15 +11,15 @@
  *  Supported compilers for building libopenmpt:
      *  **Microsoft Visual Studio 2015** or higher, running on a x86-64 build
         system (other target systems are supported)
-     *  **GCC 4.8** or higher
+     *  **GCC 5.1** or higher
      *  **Clang 3.6** or higher
-     *  **MinGW-W64 4.8** or higher (it is recommended to preferably use
+     *  **MinGW-W64 5.1** or higher (it is recommended to preferably use
         posix threading model as opposed to win32 threading model, or at least
         have mingw-std-threads available otherwise)
      *  **emscripten 1.38.5** or higher
      *  **DJGPP GCC 7.2** or higher
-     *  any other **C++11 compliant** compiler (full standard compliant mode is
-        known to work with GCC >= 5.1 and Clang)
+     *  any other **C++14 compliant** compiler (full standard compliant mode is
+        known to work with GCC >= 5.1 and Clang >= 3.6)
         
         libopenmpt makes the following assumptions about the C++ implementation
         used for building:
@@ -75,11 +75,11 @@
  *  Supported compilers for building openmpt123:
      *  **Microsoft Visual Studio 2015** or higher, running on a x86-64 build
         system (other target systems are supported)
-     *  **GCC 4.8** or higher
+     *  **GCC 5.1** or higher
      *  **Clang 3.6** or higher
-     *  **MinGW-W64 4.8** or higher
+     *  **MinGW-W64 5.1** or higher
      *  **DJGPP GCC 7.2** or higher
-     *  any **C++11 compliant** compiler
+     *  any **C++14 compliant** compiler
  *  Live sound output requires one of:
      *  **PulseAudio**
      *  **SDL 2**
Index: libopenmpt/dox/quickstart.md
===================================================================
--- libopenmpt/dox/quickstart.md	(revision 11131)
+++ libopenmpt/dox/quickstart.md	(working copy)
@@ -7,7 +7,7 @@
 
  1. Grab a `libopenmpt-VERSION.autotools.tar.gz` tarball.
  2. Get dependencies:
-     -  **gcc >= 4.8** or **clang >= 3.6**
+     -  **gcc >= 5.1** or **clang >= 3.6**
      -  **pkg-config >= 0.24**
      -  **zlib**
      -  **libogg**, **libvorbis**, **libvorbisfile**
@@ -42,7 +42,7 @@
 
  1. Get dependencies:
      -  **GNU make**
-     -  **gcc >= 4.8** or **clang >= 3.6**
+     -  **gcc >= 5.1** or **clang >= 3.6**
      -  **pkg-config**
      -  **zlib**
      -  **libogg**, **libvorbis**, **libvorbisfile**
require-cpp14-v1.patch (13,666 bytes)   
manx

manx

2019-01-02 19:12

administrator   ~0003792

Last edited: 2019-03-01 13:49

We have no automated testing infrastructure available for either Clang 3.6 or Clang 3.7. No currently supported system ships anything before Clang 3.8. We can thus require Clang >= 3.8.

manx

manx

2019-01-02 19:16

administrator   ~0003793

GCC 4.8, 4.9: r11151, r11153, r11158
std::make_unique: r11154
C++14: r11157
Clang 3.6, 3.7: r11159

manx

manx

2019-01-02 19:31

administrator   ~0003794

std::is_trivial: r11160

manx

manx

2019-01-02 19:36

administrator   ~0003795

Minimum distribution versions shipping with a supported compiler are now:
Debian 9: GCC 6
Ubuntu 16.04: GCC 5 (Ubuntu 18.04 ships GCC 7)
FreeBSD 11.0: Clang 3.8 (updated FreeBSD 11.2 even ships Clang 6)

manx

manx

2019-01-02 19:39

administrator   ~0003796

Removing VS2015 will gain us, amongst other minor things:

  • complete removal of MPT_COMPILER_QUIRK_MSVC_STRINGSTREAM, mptBufferIO.h, and thus all stringstream-related problems
  • removal of most constexpr and static_assert helper macros
  • removal of custom thread handling in Autotune.cpp
manx

manx

2019-01-03 08:39

administrator   ~0003797

Remove VS2015 patch

Saga Musix

Saga Musix

2019-01-04 10:44

administrator   ~0003798

We can also replace MPT_DEPRECATED with [[deprecated]]: https://en.cppreference.com/w/cpp/language/attributes/deprecated

manx

manx

2019-01-04 11:39

administrator   ~0003799

We can also replace MPT_DEPRECATED with [[deprecated]]:

Not literally. Attributes are to be placed on the declared names, whereas the compiler-specific syntax is generally placed on the declaration statement. See libopenmpt_config.h and libopenmpt.hpp for the implications. Placing the attribute the same as MPT_DEPRECATED is currently placed, usually results in applying it to the type or return type (which is mostly meaningless).

Also, a lot of MPT_DEPRECATED function declarations could actually be replaced by = delete declarations.

Saga Musix

Saga Musix

2019-01-07 08:19

administrator   ~0003802

Interestingly, cppreference.com seem to disagree:

function: [[deprecated]] void f();,

manx

manx

2019-01-07 09:31

administrator   ~0003803

cppreference is not 100% in line with the standard (although it probably is in the quoted aspect).

Fact being, compilers differ in practice from both cppreference and the standard with regards to where they allow and/or honor [[deprecated]], and in particular they also differ from their own rules concerning __attribuite__((deprecated)) or __declspec(deprecated).

I would have to re-test the details, but with regards to function declarations, there are differences concerning placement of export and visibility specifies and deprecated attribute (like LIBOPENMPT_ATTR_DEPRECATED LIBOPENMPT_CXX_API LIBOPENMPT_DEPRECATED double could_open_propability( std::istream & stream, double effort = 1.0, std::ostream & log = std::clog );) and placement of the attribute in variable declarations (like LIBOPENMPT_DEPRECATED static const char library_version LIBOPENMPT_ATTR_DEPRECATED [] = &quot;library_version&quot;;).

IIRC, all of 1. working, 2. compile error, 3. silently ignoring the attribute and not issuing any deprecation warning, is possible if placed wrongly.

Granted, inside OpenMPT/libopenmpt (as opposed to the public libopenmpt interface header), we are mostly deprecating functions instead of variables , and we are unlikely to care about symbol visibility. Still, the pitfalls warrant closer inspection of most use sites (which includes testing with all 3 compilers).

manx

manx

2019-03-31 12:23

administrator   ~0003908

r11501, r11502, r11503 remove VS2015

manx

manx

2019-07-03 12:23

administrator   ~0003971

[[deprecated]] implemented in r11708

Issue History

Date Modified Username Field Change
2018-12-30 16:51 manx New Issue
2018-12-30 16:51 manx Status new => assigned
2018-12-30 16:51 manx Assigned To => manx
2018-12-30 16:51 manx Relationship added related to 0000836
2018-12-30 16:52 manx Relationship added related to 0000846
2018-12-30 16:52 manx Relationship added related to 0001098
2018-12-31 08:34 manx File Added: require-cpp14-v1.patch
2018-12-31 08:34 manx Note Added: 0003786
2018-12-31 08:47 manx Description Updated
2019-01-02 11:59 manx File Added: require-cpp14-v2.patch
2019-01-02 19:12 manx Note Added: 0003792
2019-01-02 19:16 manx Note Added: 0003793
2019-01-02 19:31 manx Note Added: 0003794
2019-01-02 19:36 manx Note Added: 0003795
2019-01-02 19:39 manx Note Added: 0003796
2019-01-03 08:39 manx Note Added: 0003797
2019-01-03 08:40 manx File Added: remove-vs2015-v2.zip
2019-01-03 12:47 manx Relationship added related to 0001185
2019-01-04 10:44 Saga Musix Note Added: 0003798
2019-01-04 11:39 manx Note Added: 0003799
2019-01-05 18:27 manx File Added: remove-vs2015-v3.zip
2019-01-07 08:19 Saga Musix Note Added: 0003802
2019-01-07 09:31 manx Note Added: 0003803
2019-03-01 13:49 manx Note Edited: 0003792
2019-03-31 12:23 manx Note Added: 0003908
2019-07-01 18:33 manx Description Updated
2019-07-03 12:23 manx Note Added: 0003971
2019-08-25 15:56 manx Relationship added related to 0001256
2019-08-31 11:11 manx Description Updated
2019-08-31 11:11 manx Description Updated
2019-09-05 15:21 manx Status assigned => resolved
2019-09-05 15:21 manx Resolution open => fixed
2019-09-05 15:21 manx Fixed in Version => OpenMPT 1.29.01.00 / libopenmpt 0.5.0 (upgrade first)