Skip to content

Commit

Permalink
hdata/tests/stubs.c: fix GCC8 warning
Browse files Browse the repository at this point in the history
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@linux.ibm.com>
  • Loading branch information
stewartsmith committed May 29, 2018
1 parent 55ef0db commit f708f67
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hdata/test/stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f708f67

Please sign in to comment.