Browse Source

intermediate changes
ref:59368756f9863b1a4b8fbfb0c964bbb94cc79286

arcadia-devtools 3 years ago
parent
commit
426bb223c9
1 changed files with 30 additions and 14 deletions
  1. 30 14
      build/ymake_conf.py

+ 30 - 14
build/ymake_conf.py

@@ -1532,11 +1532,19 @@ class GnuCompiler(Compiler):
         emit_big('''
             when ($NO_WSHADOW == "yes") {
                 C_WARNING_OPTS += -Wno-shadow
-            }
+            }''')
+
+        # Though -w is intended to switch off all the warnings,
+        # it does not switch at least -Wregister and -Wreserved-user-defined-literal under clang.
+        #
+        # Use -Wno-everything to force warning suppression.
+        emit_big('''
             when ($NO_COMPILER_WARNINGS == "yes") {
                 C_WARNING_OPTS = -w
                 CXX_WARNING_OPTS = -Wno-everything
-            }
+            }''')
+
+        emit_big('''
             when ($NO_OPTIMIZE == "yes") {
                 OPTIMIZE = -O0
             }
@@ -2449,12 +2457,6 @@ class MSVCCompiler(MSVC, Compiler):
             if target.is_x86_64:
                 flags.append('-m64')
 
-            # Some warnings are getting triggered even when NO_COMPILER_WARNINGS is enabled
-            flags.extend((
-                '-Wno-c++11-narrowing',
-                '-Wno-register',
-            ))
-
             c_warnings.extend((
                 '-Wno-absolute-value',
                 '-Wno-bitwise-op-parentheses',
@@ -2477,7 +2479,6 @@ class MSVCCompiler(MSVC, Compiler):
 
             cxx_warnings += [
                 '-Woverloaded-virtual',
-                '-Wno-register',  # IGNIETFERRO-722 needed for contrib
                 '-Wimport-preprocessor-directive-pedantic',
                 '-Wno-undefined-var-template',
             ]
@@ -2591,11 +2592,26 @@ class MSVCCompiler(MSVC, Compiler):
         emit_big('''
             when ($NO_WSHADOW == "yes") {
                 C_WARNING_OPTS += /wd4456 /wd4457
-            }
-            when ($NO_COMPILER_WARNINGS == "yes") {
-                C_WARNING_OPTS = /w
-                CXX_WARNING_OPTS =
-            }
+            }''')
+
+        if self.tc.use_clang:
+            # Though /w is intended to switch off all the warnings,
+            # it does not switch at least -Wregister and -Wreserved-user-defined-literal under clang-cl.
+            #
+            # Use -Wno-everything to force warning suppression.
+            emit_big('''
+                when ($NO_COMPILER_WARNINGS == "yes") {
+                    C_WARNING_OPTS = /w
+                    CXX_WARNING_OPTS = -Wno-everything
+                }''')
+        else:
+            emit_big('''
+                when ($NO_COMPILER_WARNINGS == "yes") {
+                    C_WARNING_OPTS = /w
+                    CXX_WARNING_OPTS =
+                }''')
+
+        emit_big('''
             when ($NO_OPTIMIZE == "yes") {
                 OPTIMIZE = /Od
             }''')