-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[libc++] Reduce the number of warnings when running SPEC #160366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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.
@llvm/pr-subscribers-libcxx Author: Louis Dionne (ldionne) ChangesUsing -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. Full diff: https://github.com/llvm/llvm-project/pull/160366.diff 1 Files Affected:
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
|
You can test this locally with the following command:darker --check --diff -r origin/main...HEAD libcxx/test/benchmarks/spec.gen.py
View the diff from darker here.--- spec.gen.py 2025-09-23 18:48:17.000000 +0000
+++ spec.gen.py 2025-09-23 18:52:17.006291 +0000
@@ -27,16 +27,19 @@
flags = (test_dir / 'flags.subs').open().read().strip()
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', '')
+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'
-spec_config.write_text(f"""
+spec_config = test_dir / "spec-config.cfg"
+spec_config.write_text(
+ f"""
default:
ignore_errors = 1
iterations = 1
label = spec-stdlib
log_line_width = 4096
@@ -51,11 +54,12 @@
CC = cc -O3
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
-""")
+"""
+)
# Build the list of benchmarks. We take all intrate and fprate benchmarks that contain C++ and
# discard the ones that contain Fortran, since this test suite isn't set up to build Fortran code.
spec_benchmarks = set()
no_fortran = set()
|
# 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', '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we ever care about the warnings, do we? In that case we might as well just pass -w
.
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.