esp-baidu 适配中 makefile 注意点之二

屏蔽编译器警告/错误方法

适配过程中,可通过如下方式屏蔽编译器警告或错误。

DISABLE_ALL_CWARNING := 0

ifeq ($(DISABLE_ALL_CWARNING), 1)

CFLAGS += -w

else

CFLAGS += -Wno-error=char-subscripts
CFLAGS += -Wno-error=enum-compare
CFLAGS += -Wno-error=pointer-sign

CFLAGS += -Wno-unused-function
CFLAGS += -Wno-unused-function
CFLAGS += -Wno-missing-field-initializers
CFLAGS += -Wno-char-subscripts
CFLAGS += -Wno-unused-function
CFLAGS += -Wno-pointer-sign
CFLAGS += -Wno-enum-compare
CFLAGS += -Wno-unused-variable
CFLAGS += -Wno-sign-promo-Wall-Wno-unused-parameter

endif

说明:

  • CFLAGS += -w : 强制屏蔽所有 warning 和弱错误
  • CFLAGS += -Wno-error= 屏蔽弱错误
  • CFLAGS += -Wno- 屏蔽警告

你可能感兴趣的:(编译系统相关,makefile,esp32,esp8266)