Context
While working on PR #4574, we found that sdk/include/opentelemetry/sdk/metrics/view/predicate_factory.h uses uint8_t without including <cstdint>. It compiled only because something else in the same translation unit happened to pull that header in transitively. This kind of bug is exactly what include-what-you-use (IWYU) checks are meant to catch, but it slipped through because this header has no matching .cc file of its own to anchor an IWYU check against.
Proposal
Look into extending the project's IWYU tooling/CI so that header-only files (headers with no corresponding .cc translation unit in the same directory) are also checked for missing or unnecessary includes, rather than relying on incidental coverage from whichever .cc file happens to include them first.
Related
Context
While working on PR #4574, we found that
sdk/include/opentelemetry/sdk/metrics/view/predicate_factory.husesuint8_twithout including<cstdint>. It compiled only because something else in the same translation unit happened to pull that header in transitively. This kind of bug is exactly what include-what-you-use (IWYU) checks are meant to catch, but it slipped through because this header has no matching.ccfile of its own to anchor an IWYU check against.Proposal
Look into extending the project's IWYU tooling/CI so that header-only files (headers with no corresponding
.cctranslation unit in the same directory) are also checked for missing or unnecessary includes, rather than relying on incidental coverage from whichever.ccfile happens to include them first.Related