From: Patrick Steinhardt <ps@pks.im>
To: Ben Knoble <ben.knoble@gmail.com>
Cc: correctmost <cmlists@sent.com>,
git@vger.kernel.org, Adrian Ratiu <adrian.ratiu@collabora.com>
Subject: Re: [Bug] hook: -Wanalyzer-deref-before-check warning in run_hooks_opt
Date: Fri, 9 Jan 2026 17:18:54 +0100 [thread overview]
Message-ID: <aWEqbqPRq5Ie9XTo@pks.im> (raw)
In-Reply-To: <7BD989A0-30B1-418E-9257-1731724DCB72@gmail.com>
On Fri, Jan 09, 2026 at 11:02:40AM -0500, Ben Knoble wrote:
>
> > Le 9 janv. 2026 à 06:31, Patrick Steinhardt <ps@pks.im> a écrit :
>
> [snip]
>
> > And we'd reliably
> > segfault anyway if we dereference the pointer, even though we would not
> > get a clean error message. Not sure whether that really is worth the
> > hassle though.
>
> I think you’re probably right in practice, but doesn’t the standard just say dereferencing a NULL pointer is undefined behavior? Just wondering for my own curiosity :)
It is, yeah. But I'd claim that on almost all platforms out there it
would segfault anyway.
Patrick
next prev parent reply other threads:[~2026-01-09 16:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-09 1:24 [Bug] hook: -Wanalyzer-deref-before-check warning in run_hooks_opt correctmost
2026-01-09 11:31 ` Patrick Steinhardt
2026-01-09 12:33 ` Adrian Ratiu
2026-01-09 16:02 ` Ben Knoble
2026-01-09 16:18 ` Patrick Steinhardt [this message]
2026-01-09 22:18 ` brian m. carlson
2026-01-11 14:20 ` Adrian Ratiu
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=aWEqbqPRq5Ie9XTo@pks.im \
--to=ps@pks.im \
--cc=adrian.ratiu@collabora.com \
--cc=ben.knoble@gmail.com \
--cc=cmlists@sent.com \
--cc=git@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.