[libc-commits] [libc] [libc]: Add `-Wglobal-constructors` (PR #131485)

Vinay Deshmukh via libc-commits libc-commits at lists.llvm.org
Sat Mar 15 19:03:19 PDT 2025


https://github.com/vinay-deshmukh created https://github.com/llvm/llvm-project/pull/131485

* Relates to: https://github.com/llvm/llvm-project/issues/119281
* Enables `-Wglobal-constructors`

>From 6dd5a77e6f107b5f83d82405a2f4346498228e73 Mon Sep 17 00:00:00 2001
From: Vinay Deshmukh <32487576+vinay-deshmukh at users.noreply.github.com>
Date: Sat, 15 Mar 2025 22:01:35 -0400
Subject: [PATCH] `-Wglobal-constructors`

---
 libc/cmake/modules/LLVMLibCTestRules.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libc/cmake/modules/LLVMLibCTestRules.cmake b/libc/cmake/modules/LLVMLibCTestRules.cmake
index 45a36abd8ce1b..fef670885229c 100644
--- a/libc/cmake/modules/LLVMLibCTestRules.cmake
+++ b/libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -57,7 +57,7 @@ function(_get_common_test_compile_options output_var c_test flags)
       list(APPEND compile_options "-Wnewline-eof")
       list(APPEND compile_options "-Wnonportable-system-include-path")
       list(APPEND compile_options "-Wthread-safety")
-      # list(APPEND compile_options "-Wglobal-constructors")
+      list(APPEND compile_options "-Wglobal-constructors")
     endif()
   endif()
   set(${output_var} ${compile_options} PARENT_SCOPE)



More information about the libc-commits mailing list