diff --git a/.waf-tools/default-compiler-flags.py b/.waf-tools/default-compiler-flags.py
index 8c71871..4aa9e9b 100644
--- a/.waf-tools/default-compiler-flags.py
+++ b/.waf-tools/default-compiler-flags.py
@@ -3,10 +3,12 @@
 import platform
 from waflib import Configure, Logs, Utils
 
+
 def options(opt):
     opt.add_option('--debug', '--with-debug', action='store_true', default=False,
                    help='Compile in debugging mode with minimal optimizations (-Og)')
 
+
 def configure(conf):
     conf.start_msg('Checking C++ compiler version')
 
@@ -48,7 +50,7 @@
     else:
         conf.end_msg(ccverstr)
 
-    conf.areCustomCxxflagsPresent = (len(conf.env.CXXFLAGS) > 0)
+    conf.areCustomCxxflagsPresent = len(conf.env.CXXFLAGS) > 0
 
     # General flags are always applied (e.g., selecting C++ language standard)
     generalFlags = conf.flags.getGeneralFlags(conf)
@@ -56,6 +58,7 @@
     conf.add_supported_linkflags(generalFlags['LINKFLAGS'])
     conf.env.DEFINES += generalFlags['DEFINES']
 
+
 @Configure.conf
 def check_compiler_flags(conf):
     # Debug or optimized CXXFLAGS and LINKFLAGS are applied only if the
@@ -78,10 +81,11 @@
 
     conf.env.DEFINES += extraFlags['DEFINES']
 
+
 @Configure.conf
 def add_supported_cxxflags(self, cxxflags):
     """
-    Check which cxxflags are supported by compiler and add them to env.CXXFLAGS variable
+    Check which cxxflags are supported by the active compiler and add them to env.CXXFLAGS variable.
     """
     if len(cxxflags) == 0:
         return
@@ -97,10 +101,11 @@
     self.end_msg(' '.join(supportedFlags))
     self.env.prepend_value('CXXFLAGS', supportedFlags)
 
+
 @Configure.conf
 def add_supported_linkflags(self, linkflags):
     """
-    Check which linkflags are supported by compiler and add them to env.LINKFLAGS variable
+    Check which linkflags are supported by the active compiler and add them to env.LINKFLAGS variable.
     """
     if len(linkflags) == 0:
         return
@@ -117,7 +122,7 @@
     self.env.prepend_value('LINKFLAGS', supportedFlags)
 
 
-class CompilerFlags(object):
+class CompilerFlags:
     def getCompilerVersion(self, conf):
         return tuple(int(i) for i in conf.env.CC_VERSION)
 
@@ -133,94 +138,100 @@
         """Get dict of CXXFLAGS, LINKFLAGS, and DEFINES that are needed only in optimized mode"""
         return {'CXXFLAGS': [], 'LINKFLAGS': [], 'DEFINES': ['NDEBUG']}
 
-class GccBasicFlags(CompilerFlags):
+
+class GccClangCommonFlags(CompilerFlags):
     """
-    This class defines basic flags that work for both gcc and clang compilers
+    This class defines common flags that work for both gcc and clang compilers.
     """
+
     def getGeneralFlags(self, conf):
-        flags = super(GccBasicFlags, self).getGeneralFlags(conf)
+        flags = super().getGeneralFlags(conf)
         flags['CXXFLAGS'] += ['-std=c++17']
         if Utils.unversioned_sys_platform() != 'darwin':
             flags['LINKFLAGS'] += ['-fuse-ld=lld']
         return flags
 
+    __cxxFlags = [
+        '-fdiagnostics-color',
+        '-Wall',
+        '-Wextra',
+        '-Wpedantic',
+        '-Wenum-conversion',
+        '-Wextra-semi',
+        '-Wnon-virtual-dtor',
+        '-Wno-unused-parameter',
+    ]
+    __linkFlags = ['-Wl,-O1']
+
     def getDebugFlags(self, conf):
-        flags = super(GccBasicFlags, self).getDebugFlags(conf)
-        flags['CXXFLAGS'] += ['-Og',
-                              '-g3',
-                              '-Wall',
-                              '-Wextra',
-                              '-Wpedantic',
-                              '-Werror',
-                              '-Wcatch-value=2',
-                              '-Wextra-semi',
-                              '-Wnon-virtual-dtor',
-                              '-Wno-error=deprecated-declarations', # Bug #3795
-                              '-Wno-error=maybe-uninitialized', # Bug #1615
-                              '-Wno-unused-parameter',
-                              ]
-        flags['LINKFLAGS'] += ['-Wl,-O1']
+        flags = super().getDebugFlags(conf)
+        flags['CXXFLAGS'] += ['-Og', '-g'] + self.__cxxFlags + [
+            '-Werror',
+            '-Wno-error=deprecated-declarations', # Bug #3795
+            '-Wno-error=maybe-uninitialized', # Bug #1615
+        ]
+        flags['LINKFLAGS'] += self.__linkFlags
         return flags
 
     def getOptimizedFlags(self, conf):
-        flags = super(GccBasicFlags, self).getOptimizedFlags(conf)
-        flags['CXXFLAGS'] += ['-O2',
-                              '-g',
-                              '-Wall',
-                              '-Wextra',
-                              '-Wpedantic',
-                              '-Wcatch-value=2',
-                              '-Wextra-semi',
-                              '-Wnon-virtual-dtor',
-                              '-Wno-unused-parameter',
-                              ]
-        flags['LINKFLAGS'] += ['-Wl,-O1']
+        flags = super().getOptimizedFlags(conf)
+        flags['CXXFLAGS'] += ['-O2', '-g1'] + self.__cxxFlags
+        flags['LINKFLAGS'] += self.__linkFlags
         return flags
 
-class GccFlags(GccBasicFlags):
+
+class GccFlags(GccClangCommonFlags):
+    __cxxFlags = [
+        '-Wcatch-value=2',
+        '-Wcomma-subscript', # enabled by default in C++20
+        '-Wduplicated-branches',
+        '-Wduplicated-cond',
+        '-Wlogical-op',
+        '-Wredundant-tags',
+        '-Wvolatile', # enabled by default in C++20
+    ]
+
     def getDebugFlags(self, conf):
-        flags = super(GccFlags, self).getDebugFlags(conf)
-        flags['CXXFLAGS'] += ['-fdiagnostics-color',
-                              '-Wredundant-tags',
-                              ]
+        flags = super().getDebugFlags(conf)
+        flags['CXXFLAGS'] += self.__cxxFlags
         if platform.machine() == 'armv7l':
             flags['CXXFLAGS'] += ['-Wno-psabi'] # Bug #5106
         return flags
 
     def getOptimizedFlags(self, conf):
-        flags = super(GccFlags, self).getOptimizedFlags(conf)
-        flags['CXXFLAGS'] += ['-fdiagnostics-color',
-                              '-Wredundant-tags',
-                              ]
+        flags = super().getOptimizedFlags(conf)
+        flags['CXXFLAGS'] += self.__cxxFlags
         if platform.machine() == 'armv7l':
             flags['CXXFLAGS'] += ['-Wno-psabi'] # Bug #5106
         return flags
 
-class ClangFlags(GccBasicFlags):
+
+class ClangFlags(GccClangCommonFlags):
     def getGeneralFlags(self, conf):
-        flags = super(ClangFlags, self).getGeneralFlags(conf)
+        flags = super().getGeneralFlags(conf)
         if Utils.unversioned_sys_platform() == 'darwin':
             # Bug #4296
             brewdir = '/opt/homebrew' if platform.machine() == 'arm64' else '/usr/local'
-            flags['CXXFLAGS'] += [['-isystem', f'{brewdir}/include'], # for Homebrew
-                                  ['-isystem', '/opt/local/include']] # for MacPorts
+            flags['CXXFLAGS'] += [
+                ['-isystem', f'{brewdir}/include'], # for Homebrew
+                ['-isystem', '/opt/local/include'], # for MacPorts
+            ]
         elif Utils.unversioned_sys_platform() == 'freebsd':
             # Bug #4790
             flags['CXXFLAGS'] += [['-isystem', '/usr/local/include']]
         return flags
 
+    __cxxFlags = [
+        '-Wundefined-func-template',
+        '-Wno-unused-local-typedef', # Bugs #2657 and #3209
+    ]
+
     def getDebugFlags(self, conf):
-        flags = super(ClangFlags, self).getDebugFlags(conf)
-        flags['CXXFLAGS'] += ['-fcolor-diagnostics',
-                              '-Wundefined-func-template',
-                              '-Wno-unused-local-typedef', # Bugs #2657 and #3209
-                              ]
+        flags = super().getDebugFlags(conf)
+        flags['CXXFLAGS'] += self.__cxxFlags
         return flags
 
     def getOptimizedFlags(self, conf):
-        flags = super(ClangFlags, self).getOptimizedFlags(conf)
-        flags['CXXFLAGS'] += ['-fcolor-diagnostics',
-                              '-Wundefined-func-template',
-                              '-Wno-unused-local-typedef', # Bugs #2657 and #3209
-                              ]
+        flags = super().getOptimizedFlags(conf)
+        flags['CXXFLAGS'] += self.__cxxFlags
         return flags
