From 0cd0fea365b5cd01e8e74bc55404a3c6c6dc032c Mon Sep 17 00:00:00 2001 From: "Dongkyun, Son" Date: Fri, 28 Oct 2016 23:12:51 +0900 Subject: fix build error by Werror Different semantics for inline functions While -std=gnu89 employs the GNU89 inline semantics, -std=gnu11 uses the C99 inline semantics. The C99 inline semantics requires that if a function with external linkage is declared with inline function specifier, it also has to be defined in the same translation unit (TU). Consequently, GCC now warns if it sees a TU such as the following: inline int foo (void); This example now gives the following diagnostic: f.c:1:12: warning: inline function 'foo' declared but never defined inline int foo (void); Signed-off-by: Dongkyun, Son --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fed3abf..9f6c48b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ FOREACH(flag ${${fw_name}_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag} -Werror") ENDFOREACH(flag) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC ") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -fgnu89-inline ") SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -Wall -Werror") IF("${ARCH}" STREQUAL "arm") -- cgit v1.2.3