https://github.com/aaronpuchert commented:
Two additional checks that might be interesting: * Look at the `FormatIdx` argument. Is it a `DeclRefExpr` referring to a `ParmVarDecl`, perhaps with some conversions? (There is probably going to be an `LValueToRValue` conversion at least. There are special `Ignore*` functions on `Expr` to unwrap that.) If it is, we should propagate the attribute, if not then not. * For `FirstArg` it seems that GCC only warns when we call a `v*` function, or the called function has `FirstArg == 0`, probably because forwarding to a variadic function isn't really possible in C. It doesn't seem to check whether we're actually forwarding. What you've implemented here (deciding based on `ParentFuncDecl->isVariadic()`) seems like a reasonable heuristic. But it probably makes sense to additionally restrict based on the archetype or `FirstArg`. Or is that what you're doing with `Args[Attr->getFirstArg()]`? https://github.com/llvm/llvm-project/pull/70024 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits