nickdesaulniers wrote:

> Is there some way we can narrow the scope of this patch so we don't lose 
> warnings for normal `snprintf`s, only for the kernel one? If we really can't 
> tell the difference from the source code, we could move the affected warnings 
> to a different warning group instead, so the kernel can turn them off.

@zygoloid is this approach acceptable?

One thing I do worry about not having an explicit flag; we support clang-11+ 
for building the Linux kernel.

Let's say the kernel adds a new extension format specifiers `%pn`.  We need to 
fix up clang to recognize that now, too.  Then we fix clang in say clang-19.  
clang-18 still warns and we can't turn it off.

Perhaps it would be better to have the flag to disable `%p` without disabling 
the rest of `-Wfortify-source`, than try to keep these two in sync.

https://github.com/llvm/llvm-project/pull/65969
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to