Subject: bug#78250: 31.0.50; Eglot: eglot-show-call-hierarchy

From: João Távora <[email-masked]>
Date: Fri, 09 May 2025 09:22:16 +0100

Gerd Möllmann <[email-masked]> writes:

> João Távora <[email-masked]> writes:
>
>> 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]
>
> Hm, is there something wrong with the flexible array members in Emacs?

No reason to think so, but I get a "unknown flag -fstrict-flex-arrays"
diagnostic from clangd (both versions 19 and 21git), which I presume
comes from that flag being mentioned in compile_commands.json but not
understood by the clang compiler that lives in clangd.  These are
relatively common in projects with very specific flags.  The patch above
fixes the situation while also telling clangd that we are using strict
flex arrays (in case that influences its analysis).

If you don't get that diagonstic, perhaps you're using a hand-rolled
compile_commands.json.  I used simply `bear -- make` to create mine
after deleting src/*.o.

João