[Skiboot] [PATCH 1/7] hdata/tests/stubs.c: fix GCC8 warning

Stewart Smith stewart at linux.ibm.com
Tue May 29 16:18:04 AEST 2018


hdata/test/stubs.c:112:11: error: ‘lock_caller’ alias between functions of incompatible types ‘void(void)’ and ‘_Bool(void)’ [-Werror=attribute-alias]
 NOOP_STUB(lock_caller);
           ^~~~~~~~~~~

We fix it by giving the correct prototype to our stub

Signed-off-by: Stewart Smith <stewart at linux.ibm.com>
---
 hdata/test/stubs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hdata/test/stubs.c b/hdata/test/stubs.c
index 92098bfacff4..592257051bd2 100644
--- a/hdata/test/stubs.c
+++ b/hdata/test/stubs.c
@@ -103,9 +103,9 @@ static bool true_stub(void) { return true; }
 static bool false_stub(void) { return false; }
 
 #define TRUE_STUB(fnname) \
-	void fnname(void) __attribute__((weak, alias ("true_stub")))
+	bool fnname(void) __attribute__((weak, alias ("true_stub")))
 #define FALSE_STUB(fnname) \
-	void fnname(void) __attribute__((weak, alias ("false_stub")))
+	bool fnname(void) __attribute__((weak, alias ("false_stub")))
 #define NOOP_STUB FALSE_STUB
 
 TRUE_STUB(lock_held_by_me);
-- 
2.17.0



More information about the Skiboot mailing list