ifneq ($(strip $(CUSTOM_RELEASE)),TRUE) | |
WARNING_AS_ERROR := TRUE | |
else | |
WARNING_AS_ERROR := FALSE | |
endif | |
ifeq ($(strip $(LTO_BUILD)),TRUE) | |
WARNING_AS_ERROR = FALSE | |
endif | |
ifeq ($(strip $(WARNING_AS_ERROR)),TRUE) | |
BUILD_WARNING_CFLAGS += -Werror=array-bounds | |
BUILD_WARNING_CFLAGS += -Werror=enum-compare | |
BUILD_WARNING_CFLAGS += -Werror=implicit-function-declaration | |
BUILD_WARNING_CFLAGS += -Werror=implicit-int | |
BUILD_WARNING_CFLAGS += -Werror=int-to-pointer-cast | |
BUILD_WARNING_CFLAGS += -Werror=maybe-uninitialized | |
BUILD_WARNING_CFLAGS += -Werror=overflow | |
BUILD_WARNING_CFLAGS += -Werror=pointer-sign | |
BUILD_WARNING_CFLAGS += -Werror=pointer-to-int-cast | |
BUILD_WARNING_CFLAGS += -Werror=return-type | |
BUILD_WARNING_CFLAGS += -Werror=sequence-point | |
BUILD_WARNING_CFLAGS += -Werror=sizeof-pointer-memaccess | |
BUILD_WARNING_CFLAGS += -Werror=switch | |
BUILD_WARNING_CFLAGS += -Werror=uninitialized | |
BUILD_WARNING_CFLAGS += -Werror=unknown-pragmas | |
else ifeq ($(strip $(LTO_BUILD)),TRUE) | |
BUILD_WARNING_CFLAGS += -Warray-bounds | |
BUILD_WARNING_CFLAGS += -Wenum-compare | |
BUILD_WARNING_CFLAGS += -Wimplicit-function-declaration | |
BUILD_WARNING_CFLAGS += -Wimplicit-int | |
BUILD_WARNING_CFLAGS += -Wint-to-pointer-cast | |
BUILD_WARNING_CFLAGS += -Wmaybe-uninitialized | |
BUILD_WARNING_CFLAGS += -Woverflow | |
BUILD_WARNING_CFLAGS += -Wpointer-sign | |
BUILD_WARNING_CFLAGS += -Wpointer-to-int-cast | |
BUILD_WARNING_CFLAGS += -Wreturn-type | |
BUILD_WARNING_CFLAGS += -Wsequence-point | |
BUILD_WARNING_CFLAGS += -Wsizeof-pointer-memaccess | |
BUILD_WARNING_CFLAGS += -Wswitch | |
BUILD_WARNING_CFLAGS += -Wuninitialized | |
BUILD_WARNING_CFLAGS += -Wunknown-pragmas | |
endif | |
#hard code to filter out $project($flavor) | |
CLOSE_WARNING_AS_ERROR_PROJECT := | |
CLOSE_WARNING_AS_ERROR_PROJECT += MT3967_SP_LWCTG_GCCV6 |