[clang] [clang] Catch missing format attributes (PR #105479)

via cfe-commits cfe-commits at lists.llvm.org
Fri May 16 07:06:08 PDT 2025


https://github.com/apple-fcloutier requested changes to this pull request.

As I understand your change, it can only trip when -Wformat-nonliteral also trips. I think that you should implement this as a note/fixit on -Wformat-nonliteral. You should be able to leverage `checkFormatString`'s value traversal to have the same precision as -Wformat checking. I don't think that your change correctly identifies this case, for instance:

```c
void foo(const char *a, ...) {
	va_list ap;
	const char *const b = a;
	va_start(ap, a);
	vprintf(b, ap);
	va_end(ap);
}
```

whereas -Wformat will dig that deep.

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


More information about the cfe-commits mailing list