Skip to content

Clean up compiler warnings from Apple clang. - #589

Merged
Becheler merged 1 commit into
boostorg:developfrom
ascherer:fix-compiler-warnings-fron-clang
Sep 4, 2026
Merged

Clean up compiler warnings from Apple clang.#589
Becheler merged 1 commit into
boostorg:developfrom
ascherer:fix-compiler-warnings-fron-clang

Conversation

@ascherer

@ascherer ascherer commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Before submitting

  • This PR targets the develop branch.
  • I searched for an existing PR or issue covering the same change.
    Might be of interest for issue State of warnings in CI develop #496.
  • My contribution is licensed under the Boost Software License 1.0.

Type of change

  • Bug fix
  • New feature or API addition
  • Refactor (no behavior change)
  • Documentation
  • Build, CI, or tooling
  • Other (specify below)

Does this PR introduce a breaking change?

  • Yes (describe migration impact below)
  • No

What this PR does

Fixes compiler warnings in boost/stanford_graph.hpp issued by Apple clang version 21.0.0 (clang-2100.1.1.101).

In contrast to GCC 16, this compiler issues several warnings in <boost/stanford_graph.hpp>:

  1. Redefinition of preprocessor item MAX_N in gb_games.h (120) and gb_miles.h (128). Although neither of these values is actually used in the four SGB examples, we let the latter stand for miles_span.cpp.

  2. In four templates, parameter g is not used.

Motivation

Conventionally, I like to treat compiler warnings as bugs. :o)

Testing

Checklist

  • Existing tests pass (b2 in the test/ directory).
  • New behavior is covered by a test, or this is a docs / build / refactor change.
  • Documentation was updated if user-facing behavior changed.
  • No new compiler warnings on the platforms I built against.

On macOS Tahoe 26.6.2 with MacOSX26.5.sdk:
$ c++ --version
Apple clang version 21.0.0 (clang-2100.1.1.101)

In contrast to GCC 16, this compiler issues several warnings in
<boost/stanford_graph.hpp>:

(1) Redefinition of preprocessor item 'MAX_N' in 'gb_games.h' (120) and
'gb_miles.h' (128). Although neither of these values is actually used in
the four SGB examples, we let the latter stand for 'miles_span.cpp'.

(2) In four templates, parameter 'g' is not used.
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

Boost dependency footprint vs develop (auto-generated).
PR run 33872982241 vs develop run 33724349044 (b51b38776b).

Header-inclusion weights (graph files pulling each direct dependency in):

No header-inclusion-weight changes.

Transitive Boost modules: 65 → 65 (0)

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

Compiler-warning counts vs develop (auto-generated).
PR run 33872982344 vs develop run 33724349100 (b51b38776b).

Job Baseline After Delta
macos (clang, 14) 438 438 0
macos (clang, 17) 401 401 0
macos (clang, 20) 401 401 0
ubuntu (clang-19, 14) 438 438 0
ubuntu (clang-19, 17) 401 401 0
ubuntu (clang-19, 20) 401 401 0
ubuntu (clang-19, 23) 401 401 0
ubuntu (gcc-14, 14) 371 371 0
ubuntu (gcc-14, 17) 367 367 0
ubuntu (gcc-14, 20) 367 367 0
ubuntu (gcc-14, 23) 367 367 0
windows_msvc_14_3 (msvc-14.3) 961 961 0

@codecov

codecov Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Becheler
Becheler merged commit 42e3a19 into boostorg:develop Sep 4, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants