[PATCH] D158562: [clang][Sema] Add truncation warning on fortified snprintf

Takuya Shimizu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 24 13:45:27 PDT 2023


hazohelet added a comment.

In D158562#4614835 <https://reviews.llvm.org/D158562#4614835>, @aaron.ballman wrote:

> Thank you for working on this!
>
> Precommit CI found an issue with libc++'s tests: https://reviews.llvm.org/harbormaster/unit/view/8606248/ -- it'd be best if those could be addressed before landing the changes.

Thanks for the heads up! I was missing that.
The reason for the false positive is that clang doesn't know that `%g` specifier can result in a print of only a single digit. (Live demo: https://godbolt.org/z/8aeqh1Wsf)


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

https://reviews.llvm.org/D158562



More information about the cfe-commits mailing list