]> git.eshelyaron.com Git - emacs.git/commitdiff
Tweak .clangd to work with gcc-compiled Emacs (bug#78367)
authorJoão Távora <joaotavora@gmail.com>
Sun, 11 May 2025 10:14:02 +0000 (11:14 +0100)
committerEshel Yaron <me@eshelyaron.com>
Mon, 12 May 2025 19:55:27 +0000 (21:55 +0200)
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

diff --git a/.clangd b/.clangd
index 469d33dfd037736d51d58d67d3c390ca6785e4b8..5c7308d64ae7bb75303aca70ee17e36a4d455b37 100644 (file)
--- 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]