[libc-commits] [libc] [libc] [Task] Prepare to enable disabled warnings (PR #122835)

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Fri Jan 24 08:46:41 PST 2025


================
@@ -25,34 +25,53 @@ function(_get_common_test_compile_options output_var c_test flags)
       list(APPEND compile_options "-ffixed-point")
     endif()
 
-    # list(APPEND compile_options "-Wall")
-    # list(APPEND compile_options "-Wextra")
+    list(APPEND compile_options "-Wall")
+    list(APPEND compile_options "-Wextra")
     # -DLIBC_WNO_ERROR=ON if you can't build cleanly with -Werror.
     if(NOT LIBC_WNO_ERROR)
-      # list(APPEND compile_options "-Werror")
+      list(APPEND compile_options "-Werror")
+
+      # TODO (https://github.com/llvm/llvm-project/issues/122367#issuecomment-2581374103)
+      list(APPEND compile_options "-Wno-unused-command-line-argument")
+
+      # TODO (https://github.com/llvm/llvm-project/issues/123434)
+      list(APPEND compile_options "-Wno-missing-field-initializers")
     endif()
-    # list(APPEND compile_options "-Wconversion")
-    # list(APPEND compile_options "-Wno-sign-conversion")
-    # list(APPEND compile_options "-Wimplicit-fallthrough")
-    # list(APPEND compile_options "-Wwrite-strings")
-    # list(APPEND compile_options "-Wextra-semi")
+    list(APPEND compile_options "-Wconversion")
+    list(APPEND compile_options "-Wno-sign-conversion")
+    list(APPEND compile_options "-Wimplicit-fallthrough")
+    list(APPEND compile_options "-Wwrite-strings")
+    list(APPEND compile_options "-Wextra-semi")
     # Silence this warning because _Complex is a part of C99.
     if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
       if(NOT c_test)
         list(APPEND compile_options "-fext-numeric-literals")
       endif()
-    else()
+    elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang$")
+      list(APPEND compile_options "-Wnewline-eof")
+      list(APPEND compile_options "-Wnonportable-system-include-path")
+      list(APPEND compile_options "-Wstrict-prototypes")
+      list(APPEND compile_options "-Wthread-safety")
+      # TODO(https://github.com/llvm/llvm-project/issues/119281) triggered in TEST_F implementation
+      list(APPEND compile_options "-Wno-global-constructors")
+
+      # TODO(https://github.com/llvm/llvm-project/issues/119281)
+      # These have been disabled for the time being to create explicit PRs for each change.
+      list(APPEND compile_options "-Wno-unused-parameter")
+      list(APPEND compile_options "-Wno-implicit-int-conversion")
+      list(APPEND compile_options "-Wno-shorten-64-to-32")
+      list(APPEND compile_options "-Wno-float-conversion")
+      list(APPEND compile_options "-Wno-implicit-float-conversion")
+      list(APPEND compile_options "-Wno-extra-semi")
----------------
nickdesaulniers wrote:

Sure. I don't mind if you need to enable `-Wextra` and add a few more `-Wno-*` options in the same PR, then work towards eliminating those new `-Wno-*` flags.

https://github.com/llvm/llvm-project/pull/122835


More information about the libc-commits mailing list