From 75d5db4b554061e348bd65d617da8b2d6b2c62eb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Sun, 11 May 2025 11:14:02 +0100 Subject: [PATCH] Tweak .clangd to work with gcc-compiled Emacs (bug#78367) A Gcc configuration of Emacs emits -fstrict-flex-arrays but clangd doesn't understand that. This causes spurious errors of "unknown flag" that prevent analysis. So tweak .clangd to the nearest clang equivalent (which is very similar). * .clangd (CompileFlags): Remove -fstrict-flex-arrays, add -fstrict-flex-arrays=3. (cherry picked from commit 9df2074a06fefa0b5bfe9714b45c383fa45d6650) --- .clangd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.clangd b/.clangd index 469d33dfd03..5c7308d64ae 100644 --- a/.clangd +++ b/.clangd @@ -2,4 +2,5 @@ If: PathMatch: "src/*.c" CompileFlags: - Add: [-Wno-unused-macros, -include=config.h] + Add: [-Wno-unused-macros, -include=config.h, -fstrict-flex-arrays=3] + Remove: [-fstrict-flex-arrays] -- 2.39.5