================
@@ -7061,6 +7140,16 @@ bool Sema::CheckFormatArguments(ArrayRef<const Expr *>
Args,
SourceMgr.isInSystemMacro(FormatLoc))
return false;
+ const LangOptions &LO = getLangOpts();
+ if (CallerParamIdx && (LO.GNUMode || LO.C23 || LO.CPlusPlus11))
+ CheckMissingFormatAttributes(this, Type, format_idx, firstDataArg, Args,
+ APK, *CallerParamIdx, Loc);
----------------
apple-fcloutier wrote:
Sure, what about the other format families? I haven't built your change to play
with it, but my suspicion is that if you enable `-Wformat-nonliteral` and
`-Wmissing-format-attribute`, then you usually will trip both:
```
#include <stdarg.h>
__attribute__((format(printf, 1, 0))) void foo(const char *, va_list);
void bar(const char *fmt, ...) {
va_list ap;
va_start(ap, fmt);
foo(fmt, ap); // <----
va_end(ap);
}
```
If that's not the case (or actually, even if that's the case), I think you
should have a test that shows we emit only one or the other.
https://github.com/llvm/llvm-project/pull/166738
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits