vvuksanovic wrote:

> > We probably want to only emit this diagnostic (or perform the check at all 
> > really) if we’re in `-std=gnuXY`/`-std=gnu++XY` mode.
> 
> Also, in non-GNU C23/C++11 mode, we can just suggest `[[gnu::format]]` instead

Switched to emitting `[[gnu::format]]` for C23/C++11, or 
`__attribute__((format))` in GNU modes. Otherwise the check is not performed.

Another possible issue is that clang supports the format attribute on 
non-variadic functions, which GCC doesn't. This diagnostic can suggest adding 
the attribute to such functions, which would cause an error when compiling with 
GCC. Should I just disable that case?

https://github.com/llvm/llvm-project/pull/166738
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to