[coreboot-gerrit] New patch to review for coreboot: 60d2025 cbfstool Makefile: Add option -D_GNU_SOURCE to meet gcc 4.8.
Zheng Bao (zheng.bao@amd.com)
gerrit at coreboot.org
Wed Apr 29 09:14:01 CEST 2015
Zheng Bao (zheng.bao at amd.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10027
-gerrit
commit 60d202554935072676a579fbf9d12dd36a54a97c
Author: zbao <fishbaozi at gmail.com>
Date: Wed Apr 29 23:33:28 2015 +0800
cbfstool Makefile: Add option -D_GNU_SOURCE to meet gcc 4.8.
My gcc 4.8 reports error when building cbfstool. Adding the
macro _GNU_SOURCE can remove the error.
cc -D_POSIX_C_SOURCE=200809L -g3 -std=c99 -Werror -Wall -Wextra -Wcast-qual
-Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes
-Wwrite-strings -c -o common.o common.c
cc1: warnings being treated as errors
common.c: In function ‘buffer_create’:
common.c:59: error: implicit declaration of function ‘strdup’
common.c:59: error: assignment makes pointer from integer without a cast
common.c: In function ‘buffer_from_file’:
common.c:82: error: assignment makes pointer from integer without a cast
make: *** [common.o] Error 1
Change-Id: I4ead356e7111c3e80ef0898a9f81c096082f700b
Signed-off-by: zbao <fishbaozi at gmail.com>
Signed-off-by: Zheng Bao <zheng.bao at amd.com>
---
util/cbfstool/Makefile | 2 +-
util/cbfstool/Makefile.inc | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/util/cbfstool/Makefile b/util/cbfstool/Makefile
index 9595773..a01e071 100644
--- a/util/cbfstool/Makefile
+++ b/util/cbfstool/Makefile
@@ -6,7 +6,7 @@ CFLAGS += -g3
CFLAGS += -std=c99 -Werror -Wall -Wextra
CFLAGS += -Wcast-qual -Wmissing-prototypes -Wredundant-decls -Wshadow
CFLAGS += -Wstrict-prototypes -Wwrite-strings
-CPPFLAGS += -D_POSIX_C_SOURCE=200809L # strdup() from string.h
+CPPFLAGS += -D_POSIX_C_SOURCE=200809L -D_GNU_SOURCE # strdup() from string.h
LINKFLAGS += -g3
CBFSTOOL_BINARY:=$(obj)/cbfstool
diff --git a/util/cbfstool/Makefile.inc b/util/cbfstool/Makefile.inc
index a846e99..7fdfc14 100644
--- a/util/cbfstool/Makefile.inc
+++ b/util/cbfstool/Makefile.inc
@@ -27,7 +27,7 @@ rmodobj += xdr.o
TOOLCFLAGS ?= -std=c99 -Werror -Wall -Wextra
TOOLCFLAGS += -Wcast-qual -Wmissing-prototypes -Wredundant-decls -Wshadow
TOOLCFLAGS += -Wstrict-prototypes -Wwrite-strings
-TOOLCPPFLAGS ?= -D_POSIX_C_SOURCE=200809L # strdup() from string.h
+TOOLCPPFLAGS ?= -D_POSIX_C_SOURCE=200809L -D_GNU_SOURCE # strdup() from string.h
TOOLLINKFLAGS ?=
ifeq ($(shell uname -s | cut -c-7 2>/dev/null), MINGW32)
More information about the coreboot-gerrit
mailing list