Skip to content

Conversation

@DanielCChen
Copy link
Contributor

@DanielCChen DanielCChen commented Jul 7, 2025

The recent change of flang-rt has code like std::size_t offset{offset_};.
It broke the 32-bit flang-rt build because Component::offset_ is of type uint64_t but size_t varies.
Clang complains

error: non-constant-expression cannot be narrowed from type 'std::uint64_t' (aka 'unsigned long long') to 'std::size_t' (aka 'unsigned long') in initializer list [-Wc++11-narrowing]
  143 |   std::size_t offset{offset_};
      |                      ^~~~~~~

This patch is to use the consistent uint64_t for offset.

@DanielCChen DanielCChen requested review from kkwli and klausler July 7, 2025 17:56
@DanielCChen DanielCChen self-assigned this Jul 7, 2025
Copy link
Contributor

@klausler klausler left a comment

Choose a reason for hiding this comment

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

Why not use a static_cast<std::size_t>(...) instead?

@DanielCChen
Copy link
Contributor Author

Why not use a static_cast<std::size_t>(...) instead?

Yeah. That would work too. Will update.

@DanielCChen DanielCChen merged commit b84696d into llvm:main Jul 8, 2025
9 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