[coreboot-gerrit] New patch to review for coreboot: 2d65612 Makefile.inc: Only add `-Wno-unused-but-set-variable` for GCC

Paul Menzel (paulepanter@users.sourceforge.net) gerrit at coreboot.org
Wed Apr 8 11:02:40 CEST 2015


Paul Menzel (paulepanter at users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/9377

-gerrit

commit 2d656121bc72566e2ddd1bcf698449a1abaab2e3
Author: Paul Menzel <paulepanter at users.sourceforge.net>
Date:   Wed Apr 8 10:53:39 2015 +0200

    Makefile.inc: Only add `-Wno-unused-but-set-variable` for GCC
    
    Clang (3.5) does not know that option.
    
    	error: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Werror,-Wunknown-warning-option]
    
    Fix up commit f69a99db (coreboot: x86: enable gc-sections) to only add
    that option, when GCC is used.
    
    Change-Id: I65b41133a806df1803ccc445e27184c579a718a0
    Signed-off-by: Paul Menzel <paulepanter at users.sourceforge.net>
---
 Makefile.inc | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/Makefile.inc b/Makefile.inc
index 2d3ae2b..10759f5 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -237,7 +237,13 @@ CPPFLAGS_common += -include $(src)/include/kconfig.h
 CFLAGS_common += -pipe -g -nostdinc
 CFLAGS_common += -nostdlib -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes
 CFLAGS_common += -Wwrite-strings -Wredundant-decls -Wno-trigraphs
-CFLAGS_common += -Wstrict-aliasing -Wshadow -Wno-unused-but-set-variable
+CFLAGS_common += -Wstrict-aliasing -Wshadow
+
+ifeq ($(CONFIG_COMPILER_GCC),y)
+# cf. commit f69a99db (coreboot: x86: enable gc-sections)
+CFLAGS_common += -Wno-unused-but-set-variable
+endif
+
 ifeq ($(CONFIG_WARNINGS_ARE_ERRORS),y)
 CFLAGS_common += -Werror
 endif



More information about the coreboot-gerrit mailing list