[libcxx-commits] [libcxx] [libc++] Reduce the number of warnings when running SPEC (PR #160366)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jan 27 11:56:00 PST 2026


https://github.com/ldionne updated https://github.com/llvm/llvm-project/pull/160366

>From 33313ae0e2761d64e76990e914d1241f7b93aade Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionne.2 at gmail.com>
Date: Tue, 23 Sep 2025 11:57:04 -0400
Subject: [PATCH 1/2] [libc++] Reduce the number of warnings when running SPEC

Using -Wall and -Wextra when building SPEC leads to extremely large
log files. Since we don't actually care about warnings in these
benchmarks, this patches tones down the number of warnings a bit.
---
 libcxx/test/benchmarks/spec.gen.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libcxx/test/benchmarks/spec.gen.py b/libcxx/test/benchmarks/spec.gen.py
index ea7b75b3d2085..de7c14db5ad8e 100644
--- a/libcxx/test/benchmarks/spec.gen.py
+++ b/libcxx/test/benchmarks/spec.gen.py
@@ -28,6 +28,9 @@
 link_flags = (test_dir / 'link_flags.subs').open().read().strip()
 spec_dir = pathlib.Path((test_dir / 'spec_dir.subs').open().read().strip())
 
+# Remove -Wall, -Wextra and -Werror from the flags since we don't care about enabling all warnings inside SPEC
+compile_flags = compile_flags.replace('-Wall', '').replace('-Wextra', '').replace('-Werror', '')
+
 # Setup the configuration file
 test_dir.mkdir(parents=True, exist_ok=True)
 spec_config = test_dir / 'spec-config.cfg'
@@ -46,7 +49,7 @@
     copies               = 1
     threads              = 1
     CC                   = cc -O3
-    CXX                  = {cxx} {compile_flags} {flags} {link_flags} -Wno-error
+    CXX                  = {cxx} {compile_flags} {flags} {link_flags}
     CC_VERSION_OPTION    = --version
     CXX_VERSION_OPTION   = --version
     EXTRA_PORTABILITY    = -DSPEC_NO_CXX17_SPECIAL_MATH_FUNCTIONS # because libc++ doesn't implement the special math functions yet

>From 84a9cfa57d4771be2a9b5b1f50ddf1b70512d544 Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionne.2 at gmail.com>
Date: Tue, 27 Jan 2026 14:33:37 -0500
Subject: [PATCH 2/2] Apply comment about -w

---
 libcxx/test/benchmarks/spec.gen.py | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/libcxx/test/benchmarks/spec.gen.py b/libcxx/test/benchmarks/spec.gen.py
index 86e614f1d5ab1..474c2b65e3f4f 100644
--- a/libcxx/test/benchmarks/spec.gen.py
+++ b/libcxx/test/benchmarks/spec.gen.py
@@ -28,9 +28,6 @@
 link_flags = (test_dir / 'link_flags.subs').open().read().strip()
 spec_dir = pathlib.Path((test_dir / 'spec_dir.subs').open().read().strip())
 
-# Remove -Wall, -Wextra and -Werror from the flags since we don't care about enabling all warnings inside SPEC
-compile_flags = compile_flags.replace('-Wall', '').replace('-Wextra', '').replace('-Werror', '')
-
 # Setup the configuration file
 test_dir.mkdir(parents=True, exist_ok=True)
 spec_config = test_dir / 'spec-config.cfg'
@@ -49,7 +46,7 @@
     copies               = 1
     threads              = 1
     CC                   = cc -O3 -std=c18 -Wno-implicit-function-declaration
-    CXX                  = {cxx} {compile_flags} {flags} {link_flags}
+    CXX                  = {cxx} {compile_flags} {flags} {link_flags} -w # turn off all warnings
     CC_VERSION_OPTION    = --version
     CXX_VERSION_OPTION   = --version
     EXTRA_PORTABILITY    = -DSPEC_NO_CXX17_SPECIAL_MATH_FUNCTIONS # because libc++ doesn't implement the special math functions yet



More information about the libcxx-commits mailing list