All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Makefile: avoid 0 as NULL pointer constant
@ 2026-06-23 13:39 Christian Göttsche
  2026-06-23 17:21 ` Stephen Smalley
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Göttsche @ 2026-06-23 13:39 UTC (permalink / raw)
  To: selinux; +Cc: Christian Göttsche

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Makefile: avoid 0 as NULL pointer constant
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Smalley @ 2026-06-23 17:21 UTC (permalink / raw)
  To: cgzones; +Cc: selinux

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>

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Makefile: avoid 0 as NULL pointer constant
  2026-06-23 17:21 ` Stephen Smalley
@ 2026-06-24 17:40   ` Petr Lautrbach
  0 siblings, 0 replies; 3+ messages in thread
From: Petr Lautrbach @ 2026-06-24 17:40 UTC (permalink / raw)
  To: selinux, Stephen Smalley, cgzones

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-06-24 17:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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.