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

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

From
Ramsay Jones <ramsay@ramsayjones.plus.com>
Date
Jul 17, 2024, 19:20 UTC
Message-ID
<8dd1a2c7-5b9f-4e2f-9c5a-d5d5758714e2@ramsayjones.plus.com>
In-Reply-To
<xmqqr0br26ok.fsf@gitster.g>
On 17/07/2024 19:51, Junio C Hamano wrote:
> Ramsay Jones <ramsay@ramsayjones.plus.com> writes:
[snip]
Show 9 quoted lines
>> I mentioned this problem to Luc on the sparse mailing list[1] and
>> he produced a patch which 'fixed' the problem in one way, but
>> caused a different problem[2]. Namely, because git passes -Wvla
>> to gcc, it now issues the 'used vla' warnings, which gcc does
>> not because of some '# pragma GCC diagnostic ignored "-Wvla"' which
>> sparse does not honor! :(
> 
> Sorry, but I do not follow.  Isn't -Wno-vla an instruction to sparse
> to tell it *not* to complain about use of vla?

It's a warning flag for both sparse and gcc. At the time, I was trying to find a solution which didn't disable the warning for gcc at the same time (iff you used sparse as a front-end to gcc, which people on git tend not to do; ie _don't_ use 'cgcc -no-compile' ;) ).

Also, I wanted a solution that didn't require setting SPARSE_FLAGS (SP_EXTRA_FLAGS didn't exist then) in the Makefile (only some people were affected).

Show 10 quoted lines
> We do not pass -Wvla or -Wno-vla to sparse ourselves.  Because the
> tool comes from the Linux land where VLA is not welcome, we'd by
> default get the "hey, you used vla here---did you mean it?" error.
> 
> And the patch by Luc Van Oostenryck in the thread you raised at
> around the end of 2023 does apply to the tip and with
> 
> 	SP_EXTRA_FLAGS += -Wno-vla
> 
> in Makefile, sparse seems to be happy when I do "make sparse".

Yes, that works because 'make sparse' does not use cgcc as a front end to gcc, and the command line has -Wvla followed by -Wno-vla, so last one wins (the sparse specific flags come after the gcc flags).

ATB, Ramsay Jones

Previous: Junio C HamanoNext: Ramsay Jones
Message 5 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.