Angel Pons has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/46319 )
Change subject: Makefile.inc: Omit unsupported warnings with non-GCC compilers ......................................................................
Makefile.inc: Omit unsupported warnings with non-GCC compilers
Clang does not support some of these warning options, and does not accept comments to indicate intentional fall-through in case statements. Do not enable them for non-GCC compilers for now. Note that this patch does not change any warnings when using the official coreboot toolchain.
TEST=Use system Clang 10.0.1 (x86_64) to build for Asrock B85M Pro4. The resulting coreboot image is able to boot and suspend/resume.
Change-Id: I4df3f89af6dac8ae65fb104a21547d5ac358221b Signed-off-by: Angel Pons th3fanbus@gmail.com --- M Makefile.inc 1 file changed, 4 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/19/46319/1
diff --git a/Makefile.inc b/Makefile.inc index 882673b..373e312 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -425,12 +425,13 @@
CFLAGS_common += -pipe -g -nostdinc -std=gnu11 CFLAGS_common += -nostdlib -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes -CFLAGS_common += -Wwrite-strings -Wredundant-decls -Wno-trigraphs -Wimplicit-fallthrough -CFLAGS_common += -Wshadow -Wdate-time -Wtype-limits -Wvla -CFLAGS_common += -Wlogical-op -Wduplicated-cond -Wdangling-else +CFLAGS_common += -Wwrite-strings -Wredundant-decls -Wno-trigraphs +CFLAGS_common += -Wshadow -Wdate-time -Wtype-limits -Wvla -Wdangling-else CFLAGS_common += -fno-common -ffreestanding -fno-builtin -fomit-frame-pointer CFLAGS_common += -fstrict-aliasing -ffunction-sections -fdata-sections -fno-pie ifeq ($(CONFIG_COMPILER_GCC),y) +# Clang does not support some warning options, and does not accept fallthrough comments +CFLAGS_common += -Wlogical-op -Wduplicated-cond -Wimplicit-fallthrough # Don't add these GCC specific flags when running scan-build ifeq ($(CCC_ANALYZER_OUTPUT_FORMAT),) CFLAGS_common += -Wno-packed-not-aligned