From: Collin Funk <collin.funk1@gmail•com>
To: Junio C Hamano <gitster@pobox•com>
Cc: git@vger•kernel.org,
"Carlo Marcelo Arenas Belón" <carenas@gmail•com>,
"Jacob Keller" <jacob.keller@gmail•com>
Subject: Re: [PATCH] cocci: do not directly access the .d_type member in struct dirent
Date: Wed, 18 Jun 2025 11:31:47 -0700 [thread overview]
Message-ID: <87ldposxyk.fsf@gmail.com> (raw)
In-Reply-To: <xmqq4iwcgbzb.fsf@gitster.g>
Junio C Hamano <gitster@pobox•com> writes:
> In "struct dirent", the presence of the .d_type member should not be
> assumed and the code should instead use DTYPE() macro, with possibly
> a fallback check to determine the type of the file.
>
> Add a rule to catch direct access to the .d_type member and use
> DTYPE() macro instead, except in the emulation code paths that work
> on platforms that do have the member. This is probably not sufficient
> to notice the lack of necessary fallback code.
>
> Signed-off-by: Junio C Hamano <gitster@pobox•com>
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.
Reviewed-by: Collin Funk <collin.funk1@gmail•com>
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).
Collin
[1] https://lore.kernel.org/git/xmqqwm98ewsd.fsf@gitster.g/T/#m4fc1f0ddf1730ffb025e37d523035bd9f6cddfae
next prev parent reply other threads:[~2025-06-18 18:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-18 17:55 [PATCH] cocci: matching (multiple) identifiers Junio C Hamano
2025-06-18 18:07 ` [PATCH] cocci: do not directly access the .d_type member in struct dirent Junio C Hamano
2025-06-18 18:31 ` Collin Funk [this message]
2025-06-18 19:29 ` Junio C Hamano
2025-06-18 19:45 ` Collin Funk
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=87ldposxyk.fsf@gmail.com \
--to=collin.funk1@gmail$(echo .)com \
--cc=carenas@gmail$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=gitster@pobox$(echo .)com \
--cc=jacob.keller@gmail$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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