Skip to content

clears gcc -Wsign-compare#514

Open
Becheler wants to merge 1 commit into
boostorg:developfrom
Becheler:fix/sign-compare-warnings
Open

clears gcc -Wsign-compare#514
Becheler wants to merge 1 commit into
boostorg:developfrom
Becheler:fix/sign-compare-warnings

Conversation

@Becheler

Copy link
Copy Markdown
Collaborator

Refs #496

Before submitting

  • This PR targets the develop branch.
  • I searched for an existing PR or issue covering the same change.
  • 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

Fix -Wsign-compare (signed/unsigned comparison) warnings on gcc.

  • include/boost/pending/detail/disjoint_sets.hpp: cast the property-map lookups to Vertex in the two link_sets asserts so they compare same-signedness (debug-only, stripped under NDEBUG).
  • example/fibonacci_heap.cpp: changed the loop counter from int to std::size_t since it is compared against w.size().
  • test/min_degree_empty.cpp: cast the loop index k to int in the BOOST_TEST comparison against the int-valued ordering.

Motivation

Refs #496

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.

@Becheler Becheler self-assigned this Jun 22, 2026
@Becheler Becheler requested a review from jeremy-murphy as a code owner June 22, 2026 12:36
@github-actions

Copy link
Copy Markdown

Compiler-warning counts vs develop (auto-generated).
PR run 27953084325 vs develop run 27866501982 (6103fa5010).

Job Baseline After Delta
macos (clang, 14) 46 46 0
macos (clang, 17) 41 41 0
macos (clang, 20) 41 41 0
ubuntu (clang-19, 14) 46 46 0
ubuntu (clang-19, 17) 46 46 0
ubuntu (clang-19, 20) 46 46 0
ubuntu (clang-19, 23) 46 46 0
ubuntu (gcc-14, 14) 28 22 -6
ubuntu (gcc-14, 17) 28 22 -6
ubuntu (gcc-14, 20) 28 22 -6
ubuntu (gcc-14, 23) 28 22 -6
windows_msvc_14_3 (msvc-14.3) 974 974 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant