[clang] [-Wunsafe-buffer-usage] Warning-only analysis no longer re-analyzes pre-compiled code (PR #198006)
Ziqing Luo via cfe-commits
cfe-commits at lists.llvm.org
Thu May 21 10:56:52 PDT 2026
================
@@ -360,6 +360,20 @@ Attribute Changes in Clang
- Name: myUnsafeFunction
UnsafeBufferUsage: true
+- When using ``-Wunsafe-buffer-usage`` without
+ ``-fsafe-buffer-usage-suggestions``, warnings are now emitted only
+ once per source file. Pre-compiled code (such as PCH or module
+ headers) is no longer repeatedly analyzed, as it is analyzed during
+ its initial compilation. (Traditionally included headers are still
+ analyzed within each translation unit that includes them). This
+ behavior matches most of other ``-W`` diagnostics.
+
+ When ``-fsafe-buffer-usage-suggestions`` is enabled, the behavior
+ remains the same as before: pre-compiled code is deserialized and
+ analyzed alongside the translation unit that uses it, because fix-it
+ suggestion analysis requires full visibility of the translation
+ unit.
----------------
ziqingluo-90 wrote:
The warning took up 12.4% of WebKit's build time, which uses unified build.
https://github.com/llvm/llvm-project/pull/198006
More information about the cfe-commits
mailing list