git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] sparse: ignore warning from new glibc headers

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 18, 2024, 07:07 UTC
Message-ID
<xmqqzfqfyy7q.fsf@gitster.g>
In-Reply-To
<ZpiAcJuAH50UlHIX@danh.dev>
Đoàn Trần Công Danh <congdanhqx@gmail.com> writes:
Show 9 quoted lines
>> BTW, I didn't expect it to take this long for this issue to come
>> back to the list! I expected it to almost immediately cause
>> problems with the sparse ci job, when the version of Ubuntu was
>> updated to the LTS (now previous LTS!). So, I just found a simple
>> solution for now (which turned into 2 years).
>
> Well, yeah, -Wno-vla would work, I used that macro __STDC_NO_VLA__
> because I'm not sure Git want to use vla or not, so I only tried to
> disable it for system headers.

Defining __STDC_NO_VLA__ would rid use of variable length arrays in the regex.h header, so "-Wno-vla" would not be necessary. It's just that it makes me feel a bit dirty to define the macro that only compiler implementations are expected to define in order to cause header files behave the way they would with a compiler without VLA.

If we apply Luc's patch [*1*] to sparse, the header would use vla in parameter in the prototype, sparse would grok it, *and* then complain that we are using vla, so we still need "-Wno-vla" on top (but "-Wno-vla" alone would not make (unpatched) sparse grok the construct, of course).

> And yes, the vla declarationw as added into glibc 2.35.
Thanks.
[Reference]
*1* https://lore.kernel.org/all/uug4xslokvlxr6z24q52z4pt7nrtiimbzunz2gz3kpilk4kxts@7jljsksi6baq/
Previous: Đoàn Trần Công DanhNext: Đoàn Trần Công Danh
Message 10 of 15 in “sparse: ignore warning from new glibc headers”
  1. sparse: ignore warning from new glibc headersĐoàn Trần Công Danh, Jul 16, 2024
  2. Junio C HamanoJul 17, 2024
  3. Ramsay JonesJul 17, 2024
  4. Junio C HamanoJul 17, 2024
  5. Ramsay JonesJul 17, 2024
  6. Ramsay JonesJul 17, 2024
  7. Junio C HamanoJul 17, 2024
  8. Ramsay JonesJul 18, 2024
  9. Đoàn Trần Công DanhJul 18, 2024
  10. Junio C HamanoJul 18, 2024
  11. Đoàn Trần Công DanhJul 18, 2024
  12. Junio C HamanoJul 18, 2024
  13. Ramsay JonesJul 19, 2024
  14. Johannes SchindelinApr 8, 2025
  15. Junio C HamanoApr 8, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.