diff --git a/.waf-tools/default-compiler-flags.py b/.waf-tools/default-compiler-flags.py
index 54db7ea..e690290 100644
--- a/.waf-tools/default-compiler-flags.py
+++ b/.waf-tools/default-compiler-flags.py
@@ -15,14 +15,14 @@
     errmsg = ''
     warnmsg = ''
     if cxx == 'gcc':
-        if ccver < (4, 8, 2):
+        if ccver < (5, 3, 0):
             errmsg = ('The version of gcc you are using is too old.\n'
-                      'The minimum supported gcc version is 4.8.2.')
+                      'The minimum supported gcc version is 5.3.0.')
         conf.flags = GccFlags()
     elif cxx == 'clang':
-        if ccver < (3, 4, 0):
+        if ccver < (3, 5, 0):
             errmsg = ('The version of clang you are using is too old.\n'
-                      'The minimum supported clang version is 3.4.0.')
+                      'The minimum supported clang version is 3.5.0.')
         conf.flags = ClangFlags()
     else:
         warnmsg = 'Note: %s compiler is unsupported' % cxx
@@ -39,7 +39,7 @@
 
     conf.areCustomCxxflagsPresent = (len(conf.env.CXXFLAGS) > 0)
 
-    # General flags are always applied (e.g., selecting C++11 mode)
+    # General flags are always applied (e.g., selecting C++ language standard)
     generalFlags = conf.flags.getGeneralFlags(conf)
     conf.add_supported_cxxflags(generalFlags['CXXFLAGS'])
     conf.add_supported_linkflags(generalFlags['LINKFLAGS'])
@@ -128,7 +128,7 @@
     """
     def getGeneralFlags(self, conf):
         flags = super(GccBasicFlags, self).getGeneralFlags(conf)
-        flags['CXXFLAGS'] += ['-std=c++11']
+        flags['CXXFLAGS'] += ['-std=c++14']
         return flags
 
     def getDebugFlags(self, conf):
@@ -164,16 +164,12 @@
 class GccFlags(GccBasicFlags):
     def getDebugFlags(self, conf):
         flags = super(GccFlags, self).getDebugFlags(conf)
-        if self.getCompilerVersion(conf) < (5, 1, 0):
-            flags['CXXFLAGS'] += ['-Wno-missing-field-initializers']
-        flags['CXXFLAGS'] += ['-fdiagnostics-color'] # gcc >= 4.9
+        flags['CXXFLAGS'] += ['-fdiagnostics-color']
         return flags
 
     def getOptimizedFlags(self, conf):
         flags = super(GccFlags, self).getOptimizedFlags(conf)
-        if self.getCompilerVersion(conf) < (5, 1, 0):
-            flags['CXXFLAGS'] += ['-Wno-missing-field-initializers']
-        flags['CXXFLAGS'] += ['-fdiagnostics-color'] # gcc >= 4.9
+        flags['CXXFLAGS'] += ['-fdiagnostics-color']
         return flags
 
 class ClangFlags(GccBasicFlags):
