Skip to content

fix: include <cstdint> where fixed-width int types are used#4

Merged
dodamih merged 2 commits into
masterfrom
fix/cstdint-includes
Jun 16, 2026
Merged

fix: include <cstdint> where fixed-width int types are used#4
dodamih merged 2 commits into
masterfrom
fix/cstdint-includes

Conversation

@nkemnitz

Copy link
Copy Markdown

Problem

Building waterz with a recent toolchain (observed with GCC 15 / cpython-3.13) fails at compile time:

src/waterz/backend/ConstraintProvider.hpp:9:45: error: 'uint64_t' has not been declared

…followed by a cascade of invalid new-expression of abstract class type and marked 'override', but does not override errors. Those are all downstream effects: with uint64_t undeclared, the base ConstraintProvider methods are parsed with an implicit int fallback, so the uint64_t-typed overrides in the subclasses (SemanticConstraintProvider, SemanticTaintConstraintProvider, SegConstraintProvider, SizeHeuristicConstraintProvider) no longer match the base signatures.

Root cause

The affected headers use uint64_t/int*_t without including <cstdint>. They previously compiled by relying on transitive includes that newer libstdc++ (GCC 13+) no longer provides.

Fix

Add explicit #include <cstdint> to each header that names fixed-width integer types:

  • backend/ConstraintProvider.hpp
  • backend/DefaultDict.hpp
  • backend/SemanticConstraintProvider.hpp
  • backend/evaluate.hpp
  • backend/types.hpp
  • frontend_agglomerate.h
  • frontend_evaluate.h

Verification

pip wheel . --no-deps now builds successfully with GCC 15 / Python 3.13:

Successfully built waterz

🤖 Generated with Claude Code

Headers that use uint64_t and friends relied on transitive includes
that newer libstdc++ (GCC 13+) no longer provides, causing build
failures such as "'uint64_t' has not been declared" and the cascade of
abstract-class / override mismatch errors that follow from the implicit
int fallback. Add explicit <cstdint> includes to each affected header.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@nkemnitz nkemnitz requested a review from dodamih May 29, 2026 13:26
edge.u/edge.v are SegID (uint64_t) while maxId was std::size_t. On Linux
these are the same underlying type so std::max deduces fine, but on
macOS uint64_t is unsigned long long and size_t is unsigned long, so
template argument deduction fails ("deduced conflicting types"). Declare
maxId as SegID so both std::max operands share a 64-bit type on every
platform, avoiding both the deduction failure and any narrowing of seg
ids toward a possibly-32-bit size_t.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@nkemnitz nkemnitz force-pushed the fix/cstdint-includes branch from 9808416 to aa08afa Compare May 29, 2026 13:35
@dodamih dodamih merged commit a891b34 into master Jun 16, 2026
6 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