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

Vladimir Vuksanovic via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 10 09:13:47 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))
----------------
vvuksanovic wrote:

> You should warn in all cases and use the language mode only to decide whether to offer a fixit.

I'm not sure if the warning that suggests adding an attribute makes sense if there isn't a portable way to actually add the attribute.



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


More information about the cfe-commits mailing list