[clang] [Sema] Suggest missing format attributes (PR #166738)

via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 7 10:33:30 PST 2025


================
@@ -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))
----------------
Sirraide wrote:

The issue I see w/ that is that for language modes that don’t support `[[]]`-style attributes, there is no way to actually make the warning go away in a portable manner (you can use a `#pragma` but that’s a bit sad and also not portable).

https://github.com/llvm/llvm-project/pull/166738


More information about the cfe-commits mailing list