[libc-commits] [libc] 6d4f464 - [libc] Build with -Wshadow (#196519)
via libc-commits
libc-commits at lists.llvm.org
Tue May 12 06:48:49 PDT 2026
Author: Nico Weber
Date: 2026-05-12T09:48:43-04:00
New Revision: 6d4f4642d978debd4c4a4057361a0a0f42de5743
URL: https://github.com/llvm/llvm-project/commit/6d4f4642d978debd4c4a4057361a0a0f42de5743
DIFF: https://github.com/llvm/llvm-project/commit/6d4f4642d978debd4c4a4057361a0a0f42de5743.diff
LOG: [libc] Build with -Wshadow (#196519)
This way, clients including libc/shared/math.h don't need to `#pragma
GCC diagnostic ignored "-Wshadow"` around the include.
This works locally after #196337 #196342 #196346.
CI also needed #196529 #196810 #196850 #196851 #196852 #196853 #196855
#196857 #196858 #196859 #196860.
Added:
Modified:
libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
Removed:
################################################################################
diff --git a/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake b/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
index 2d3703eefa0ac..db541a4dfb985 100644
--- a/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
+++ b/libc/cmake/modules/LLVMLibCCompileOptionRules.cmake
@@ -301,6 +301,7 @@ function(_get_common_compile_options output_var flags)
if(NOT CMAKE_COMPILER_IS_GNUCXX)
list(APPEND compile_options "-Wnewline-eof")
list(APPEND compile_options "-Wnonportable-system-include-path")
+ list(APPEND compile_options "-Wshadow")
list(APPEND compile_options "-Wstrict-prototypes")
list(APPEND compile_options "-Wthread-safety")
list(APPEND compile_options "-Wglobal-constructors")
More information about the libc-commits
mailing list