[libcxx-commits] [PATCH] D120532: [libcxx] Make format specifiers more portable

Stephan T. Lavavej via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Feb 25 21:07:16 PST 2022


STL_MSFT added a comment.

The microsoft/STL repo follows a convention of always avoiding functional-style C-semantics casts like `size_t(value)`, so these should be `static_cast<size_t>(value)`. (The rationale is that `size_t(value)` is willing to reinterpret pointer values and is difficult to search for.)

Separately, I am not a huge fan of the `size_t` type here - it introduces machine-bitness-variation that's unrelated to these values (which are always 32-bit). That said, there's no danger and minimal risk of confusion, and there aren't great alternatives, so I'll live with it.

Thanks for fixing these warnings!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120532/new/

https://reviews.llvm.org/D120532



More information about the libcxx-commits mailing list