0

Tell clangd to ignore -DUNSAFE_BUFFERS_BUILD flag

This compiler flag was added in https://crrev.com/c/5485646
and it causes the code to add lines declaring the pragma
`allow_unsafe_buffers` which clangd does not know.
This causes clangd to throw hundreds of `Unknown pragma ignored` errors
after which clangd just gives up on indexing.

Bug: 40284755
Test: Generate compile_commands.json with and without this fix and observe the errors when opening files in my editor.
Change-Id: I712dd2a2fa981e275229b68f5db15449d44f10fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5498358
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Auto-Submit: Jeroen Dhollander <jeroendh@google.com>
Cr-Commit-Position: refs/heads/main@{#1294438}
This commit is contained in:
Jeroen Dhollander 2024-04-30 17:19:43 +00:00 committed by Chromium LUCI CQ
parent 3ef94f60ed
commit 63b01a61be

@ -4,4 +4,4 @@ Diagnostics:
UnusedIncludes: None
MissingIncludes: None
CompileFlags:
Remove: [-cfg=*, -exec_root=*, -inputs=*]
Remove: [-cfg=*, -exec_root=*, -inputs=*, -DUNSAFE_BUFFERS_BUILD]