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

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

From
Đoàn Trần Công Danh <congdanhqx@gmail.com>
Date
Jul 18, 2024, 08:46 UTC
Message-ID
<ZpjWYHvCa_Sb_wwk@danh.dev>
In-Reply-To
<ZpiAcJuAH50UlHIX@danh.dev>
On 2024-07-18 09:39:44+0700, Đoàn Trần Công Danh <congdanhqx@gmail.com> wrote:
Show 20 quoted lines
> On 2024-07-18 01:02:54+0100, Ramsay Jones <ramsay@ramsayjones.plus.com> wrote:
> > 
> > 
> > On 17/07/2024 23:53, Junio C Hamano wrote:
> > [snip]
> > > That's OK.  So in short, with a separate SP_EXTRA_FLAGS with "-Wno-vla",
> > > Luc's patch is a sufficient fix without any downsides, no?
> > > 
> > 
> > Yes, assuming you're only concerned with 'make sparse' usage.
> > 
> > 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.
Eh, I replied too soon, -Wno-vla doesn't work with my compiler:
     $ rm -f builtin/am.sp && make V=1 builtin/am.sp
     cgcc -no-compile -I. -I.   -fstack-protector-strong -D_FORTIFY_SOURCE=2 -pipe -O2 -g -march=native  -I. -DHAVE_SYSINFO -DGIT_HOST_CPU="\"x86_64\"" -DHAVE_ALLOCA_H  -DUSE_CURL_FOR_IMAP_SEND -DSUPPORTS_SIMPLE_IPC -DSHA1_DC -DSHA1DC_NO_STANDARD_INCLUDES -DSHA1DC_INIT_SAFE_HASH_DEFAULT=0 -DSHA1DC_CUSTOM_INCLUDE_SHA1_C="\"git-compat-util.h\"" -DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C="\"git-compat-util.h\"" -DSHA256_BLK  -DHAVE_PATHS_H -DHAVE_DEV_TTY -DHAVE_CLOCK_GETTIME -DHAVE_CLOCK_MONOTONIC -DHAVE_SYNC_FILE_RANGE -DHAVE_GETDELIM '-DPROCFS_EXECUTABLE_PATH="/proc/self/exe"' -DFREAD_READS_DIRECTORIES -DNO_STRLCPY -DSHELL_PATH='"/bin/sh"'  \
            -Wsparse-error \
            -std=gnu99 -Wno-universal-initializer -Wno-vla builtin/am.c && \
     >builtin/am.sp
    builtin/am.c: note: in included file (through git-compat-util.h, builtin.h):
    /usr/include/regex.h:682:41: error: undefined identifier '__nmatch'
    /usr/include/regex.h:682:41: error: bad constant expression type
    make: *** [Makefile:3263: builtin/am.sp] Error 1
    $ gcc --version
    gcc (GCC) 13.2.0
    Copyright (C) 2023 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-- 
Danh
Previous: Junio C HamanoNext: Junio C Hamano
Message 11 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.