[PATCH] D27165: Add format_dynamic_key_arg attribute to improve "-Wformat" warnings for functions that load the formatting string dynamically based on a key value

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 13 14:54:56 PDT 2019


rjmccall added a comment.

I agree with just special-casing this for now.



================
Comment at: clang/lib/Sema/SemaChecking.cpp:6800
+            MD->getSelector() ==
+                S.NSAPIObj->getLocalizedStringForKeySelector()) {
+          IgnoreStringsWithoutSpecifiers = true;
----------------
It's more efficient to do these checks with `isStr` instead of looking up an `IdentifierInfo`.  You can add a `Selector::isKeywordSelector(ArrayRef<StringRef>)` method to make that equally convenient for selectors.


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

https://reviews.llvm.org/D27165





More information about the cfe-commits mailing list