Skip to content

[SDK] Add missing cstdint include to predicate_factory.h - #4574

Merged
dbarker merged 5 commits into
open-telemetry:mainfrom
om7057:fix/predicate-factory-missing-cstdint
Sep 16, 2026
Merged

dbarker merged 5 commits into
open-telemetry:mainfrom
om7057:fix/predicate-factory-missing-cstdint

Conversation

@om7057

@om7057 om7057 commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Fixes # (issue)

Changes

predicate_factory.h declares enum class PredicateType : uint8_t and uses uint8_t without including <cstdint>. It compiles today only because something else in the same translation unit happens to pull that header in transitively. Building it in isolation, or under a standard library that no longer provides that transitive include, fails to compile. This adds the missing #include <cstdint> directly to the header that needs it.

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

predicate_factory.h uses uint8_t but does not include cstdint, relying
on a transitive include pulled in elsewhere in the translation unit.
Building this header on its own fails with newer standard library
implementations that no longer provide that transitive include.
@om7057
om7057 requested a review from a team as a code owner September 15, 2026 14:53
@codecov

codecov Bot commented Sep 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.51%. Comparing base (1a27841) to head (f920bfc).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4574      +/-   ##
==========================================
- Coverage   86.52%   86.51%   -0.00%     
==========================================
  Files         525      525              
  Lines       20464    20464              
==========================================
- Hits        17704    17702       -2     
- Misses       2760     2762       +2     
Files with missing lines Coverage Δ
...opentelemetry/sdk/metrics/view/predicate_factory.h 90.91% <ø> (ø)

... and 1 file with indirect coverage changes

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

@lalitb lalitb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the fix. Also good to open a follow-up issue to extend our IWYU checks to headers without a matching .cc file. We can handle that separately.

@dbarker
dbarker enabled auto-merge (squash) September 16, 2026 15:46
@dbarker
dbarker merged commit e62f627 into open-telemetry:main Sep 16, 2026
75 of 76 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.

4 participants