mirror of
https://github.com/SELinuxProject/selinux
synced 2025-04-18 05:15:21 +00:00
libsepol: harden availability check against user CFLAGS
If CFLAGS set by the user contains the warnings override `-Wno-error=implicit-function-declaration` the availability check does not work properly. Explicitly enable and treat this warnings as failure by appending the appropriate flag. Also include CPPFLAGS in the check. Signed-off-by: Christian Göttsche <cgzones@googlemail.com> Acked-by: James Carter <jwcart2@gmail.com>
This commit is contained in:
parent
856895ca25
commit
d49a3ecb43
@ -31,7 +31,7 @@ endif
|
||||
|
||||
# check for reallocarray(3) availability
|
||||
H := \#
|
||||
ifeq (yes,$(shell printf '${H}include <stdlib.h>\nint main(void){return reallocarray(NULL,0,0)==NULL;}' | $(CC) $(CFLAGS) $(LDFLAGS) -x c -o /dev/null - >/dev/null 2>&1 && echo yes))
|
||||
ifeq (yes,$(shell printf '${H}include <stdlib.h>\nint main(void){return reallocarray(NULL,0,0)==NULL;}' | $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -Werror=implicit-function-declaration -x c -o /dev/null - >/dev/null 2>&1 && echo yes))
|
||||
override CFLAGS += -DHAVE_REALLOCARRAY
|
||||
endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user