This is an archive of the discontinued LLVM Phabricator instance.

Resolve overload ambiguity on Mac OS when printing size_t in diagnostics
ClosedPublic

Authored by aaronpuchert on May 13 2022, 1:17 PM.

Details

Summary

Precommit builds cover Linux and Windows, but this ambiguity would only
show up on Mac OS: there we have int32_t = int, int64_t = long long and
size_t = unsigned long. So printing a size_t, while successful on the
other two architectures, cannot be unambiguously resolved on Mac OS.

This is not really meant to support printing arguments of type long or
size_t, but more as a way to prevent build breakage that would not be
detected in precommit builds, as happened in D125429.

Technically we have no guarantee that one of these types has the 64 bits
that afdac5fbcb6a3 wanted to provide, so proposals are welcome. We do
have a guarantee though that these three types are different, so we
should be fine with overload resolution.

Diff Detail

Event Timeline

aaronpuchert created this revision.May 13 2022, 1:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 13 2022, 1:17 PM
aaronpuchert requested review of this revision.May 13 2022, 1:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 13 2022, 1:17 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
aeubanks accepted this revision.May 13 2022, 1:38 PM
This revision is now accepted and ready to land.May 13 2022, 1:38 PM