1 Commits

Author SHA1 Message Date
Takuya Shimizu
56c3b8e997
[clang][Sema] Make format size estimator aware of %p's existence in format string (#65969)
This change introduces `-Wformat-overflow` and `-Wformat-truncation` warning flags that were formerly diagnosed from `-Wfortify-source` warning group.
This also introduces `-Wformat-overflow-non-kprintf` and `-Wformat-truncation-non-kprintf`, both of which will be used when the format string contains `%p` format string.

The rationale for this is that Linux kernel has its own extension for `%p` format specifier, and we need some way to suppress false positives in kernel codebase.
The approach of this patch aims NOT to affect non-kernel codebases.
Note that GCC stops format size estimation upon `%p` format specifier.

As requested in https://github.com/llvm/llvm-project/issues/64871
2023-09-25 10:03:46 +09:00