Makefile: avoid 0 as NULL pointer constant
Subsystems (2)
PATCH 1/1 Makefile: avoid 0 as NULL pointer constant
From: Christian Göttsche <[email protected]>
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 <[email protected]>
--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
@@ -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
Signature · 1 line
2.53.0
Quoted 8 lines · Christian Göttsche
From: Christian Göttsche <[email protected]>
fts_close(3)takes a pointer as argument; use(void*)0instead of pure0to please building with-Wzero-as-null-pointer-constant. Avoid using NULL to not require <stddef.h>.Signed-off-by Christian Göttsche <[email protected]>
Acked-by Stephen Smalley <[email protected]>
Quoted 21 lines
--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Makefile +1
-2@@ -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
Quoted 5 lines · Stephen Smalley
Quoted 3 lines · Christian Göttsche
From: Christian Göttsche <[email protected]>
Quoted 7 lines
Quoted 5 lines
fts_close(3)takes a pointer as argument; use(void*)0instead of pure0to please building with-Wzero-as-null-pointer-constant. Avoid using NULL to not require <stddef.h>.Signed-off-by Christian Göttsche <[email protected]>Acked-by Stephen Smalley <[email protected]>
Merged.
Quoted 21 lines
Quoted 21 lines
--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Makefile +1
-2@@ -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