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

Re: [PATCH] cocci: do not directly access the .d_type member in struct dirent

From
Collin Funk <collin.funk1@gmail.com>
Date
Jun 18, 2025, 19:45 UTC
Message-ID
<87a564sujt.fsf@gmail.com>
In-Reply-To
<xmqqsejwetli.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 6 quoted lines
>> This change looks good to me. Atleast it will catch code that fails to
>> build on niche platforms, even if it cannot validate existing backup
>> code.
>
> I do not think it is necessarily a good idea to allow building a
> binary that is known to silently misbehave, though.

Yes, but off the top of my head I cannot think of a great way to check that DTYPE has backup code for systems that do not have d_type.

At least in the case of 'git diff --no-index' the tests will fail if we do not properly detect a file is a directory. So at least we will likely know upon running 'make test'. Still that requires manual investigation, so not perfect, though...

Show 6 quoted lines
>> Your fix for the 'git diff --no-index' looks correct [1]. I'll build libcurl
>> on an AIX machine I have access to in order to test (not an
>> administrator on it).
>
> I do not think you need libcurl if you only want to test the diff
> --no-index change, but anyway, thanks.

I assumed that it was a hard dependency and could not be disabled. Am I wrong?

Anyways, it was quick so no worries. I posted my findings [1].
Collin
[1] https://lore.kernel.org/git/87frfwsv4r.fsf@gmail.com/T/#me995c8f49943f0606c236e8e5e9ea8163602e65b
Previous: Junio C Hamano
Message 5 of 5 in “cocci: matching (multiple) identifiers”
  1. cocci: matching (multiple) identifiersJunio C Hamano, Jun 18, 2025
  2. cocci: do not directly access the .d_type member in struct direntJunio C Hamano, Jun 18, 2025
  3. Collin FunkJun 18, 2025
  4. Junio C HamanoJun 18, 2025
  5. Collin FunkJun 18, 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.