git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Đoàn Trần Công Danh" <congdanhqx@gmail.com>
Cc: Ramsay Jones <ramsay@ramsayjones.plus.com>,  git@vger.kernel.org
Subject: Re: [PATCH] sparse: ignore warning from new glibc headers
Date: Thu, 18 Jul 2024 00:07:53 -0700	[thread overview]
Message-ID: <xmqqzfqfyy7q.fsf@gitster.g> (raw)
In-Reply-To: <ZpiAcJuAH50UlHIX@danh.dev> ("Đoàn Trần Công Danh"'s message of "Thu, 18 Jul 2024 09:39:44 +0700")

Đoàn Trần Công Danh <congdanhqx@gmail.com> writes:

>> 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/

  reply	other threads:[~2024-07-18  7:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-16 23:17 [PATCH] sparse: ignore warning from new glibc headers Đoàn Trần Công Danh
2024-07-17 16:54 ` Junio C Hamano
2024-07-17 18:40   ` Ramsay Jones
2024-07-17 18:51     ` Junio C Hamano
2024-07-17 19:20       ` Ramsay Jones
2024-07-17 22:36         ` Ramsay Jones
2024-07-17 22:53           ` Junio C Hamano
2024-07-18  0:02             ` Ramsay Jones
2024-07-18  2:39               ` Đoàn Trần Công Danh
2024-07-18  7:07                 ` Junio C Hamano [this message]
2024-07-18  8:46                 ` Đoàn Trần Công Danh
2024-07-18  4:47               ` Junio C Hamano
2024-07-19  2:03                 ` Ramsay Jones
2025-04-08 20:56 ` Johannes Schindelin
2025-04-08 22:35   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqzfqfyy7q.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=congdanhqx@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=ramsay@ramsayjones.plus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).