From: Petr Lautrbach <lautrbach@redhat.com>
To: selinux@vger.kernel.org,
Stephen Smalley <stephen.smalley.work@gmail.com>,
cgzones@googlemail.com
Subject: Re: [PATCH] Makefile: avoid 0 as NULL pointer constant
Date: Wed, 24 Jun 2026 19:40:35 +0200 [thread overview]
Message-ID: <87bjczu99o.fsf@redhat.com> (raw)
In-Reply-To: <CAEjxPJ4m7__fzUnv2KP2hqLAzNvEOqn_xkH_oEMxP7hfWpHdkA@mail.gmail.com>
Stephen Smalley <stephen.smalley.work@gmail.com> writes:
> On Tue, Jun 23, 2026 at 9:40 AM Christian Göttsche
> <cgoettsche@seltendoof.de> wrote:
>>
>> From: Christian Göttsche <cgzones@googlemail.com>
>>
>> fts_close(3) takes a pointer as argument; use `(void*)0` instead of pure
>> `0` to please building with `-Wzero-as-null-pointer-constant`. Avoid
>> using NULL to not require <stddef.h>.
>>
>> Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
>
> Acked-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Merged.
>> ---
>> Makefile | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/Makefile b/Makefile
>> index 0e465f94..ae8586c6 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -29,7 +29,7 @@ endif
>>
>> # check for fts_* availability
>> H := \#
>> -ifneq (yes,$(shell printf '${H}include <fts.h>\nint main(void){return fts_close(0);}' | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -Werror=implicit-function-declaration -x c -o /dev/null - >/dev/null 2>&1 && echo yes))
>> +ifneq (yes,$(shell printf '${H}include <fts.h>\nint main(void){return fts_close((void*)0);}' | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -Werror=implicit-function-declaration -x c -o /dev/null - >/dev/null 2>&1 && echo yes))
>> export FTS_LDLIBS := -lfts
>> endif
>>
>> --
>> 2.53.0
>>
>>
prev parent reply other threads:[~2026-06-24 17:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-23 13:39 [PATCH] Makefile: avoid 0 as NULL pointer constant Christian Göttsche
2026-06-23 17:21 ` Stephen Smalley
2026-06-24 17:40 ` Petr Lautrbach [this message]
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=87bjczu99o.fsf@redhat.com \
--to=lautrbach@redhat.com \
--cc=cgzones@googlemail.com \
--cc=selinux@vger.kernel.org \
--cc=stephen.smalley.work@gmail.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