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

via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 23 11:52:46 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {darker}-->


:warning: Python code formatter, darker found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
darker --check --diff -r origin/main...HEAD libcxx/test/benchmarks/spec.gen.py
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from darker here.
</summary>

``````````diff
--- 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()

``````````

</details>


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


More information about the libcxx-commits mailing list