[PATCH] D81667: [RFC, FileCheck] Add precision to format specifier
Thomas Preud'homme via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 18 01:03:33 PDT 2020
thopre added a comment.
In D81667#2100049 <https://reviews.llvm.org/D81667#2100049>, @jhenderson wrote:
> In D81667#2098944 <https://reviews.llvm.org/D81667#2098944>, @jdenny wrote:
>
> > > I'd expect 0x[[#%.8x, ADDR:]] to match 00001234 or FFFFFFFF12345678 but not 1234 due to there not being enough digits.
> >
> > OK, it would expect a value that could have been printed by printf with `%.8x`.
>
>
> FWIW, this is what I'm imagining the overall behaviour to be. If printf could have produced the output for a given format specifier, we should accept it, and conversely if it can't produce the output for a given format specifier, we shouldn't accept it.
>
> I'm not sure whether we should consume all digits before applying the precision check or not though. I can see benefits for either side.
We currently accept numbers with leading zeroes but printf would not produce those without a precision. Should we start by fixing this then?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D81667/new/
https://reviews.llvm.org/D81667
More information about the llvm-commits
mailing list