[PATCH] D158318: [Sema] tolerate more promotion matches in format string checking

FĂ©lix Cloutier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 24 14:51:35 PDT 2023


fcloutier updated this revision to Diff 553271.
fcloutier added a comment.

It seems that clang allows `char` specifiers to match `bool` in `scanf` today, without my change (https://godbolt.org/z/e8PrjY65h). I think that this is a mistake, but that's almost certainly up for debate and I'd like to avoid scope creep on this change.

The new format-strings-scanf.cpp file covers the correct and "barely wrong" cases that I could think of.


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

https://reviews.llvm.org/D158318

Files:
  clang/docs/ReleaseNotes.rst
  clang/lib/AST/FormatString.cpp
  clang/test/Sema/attr-format.c
  clang/test/SemaCXX/attr-format.cpp
  clang/test/SemaCXX/format-strings-scanf.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158318.553271.patch
Type: text/x-patch
Size: 7921 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230824/92594530/attachment-0001.bin>


More information about the cfe-commits mailing list