From 051605522497733f202cd00a1702b823e6e4fb3a Mon Sep 17 00:00:00 2001 From: Gianfranco Costamagna Date: Wed, 22 Jan 2025 12:22:37 +0100 Subject: [PATCH] test/libmallocintercept.c: fix write function unused return value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We should ignore the return value for logging function, to fix a new gcc ftbfs libmallocintercept.c: In function ‘print_msg’: libmallocintercept.c:27:9: error: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result] 27 | write(0, msg, strlen(msg)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~ --- test/libmallocintercept.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/libmallocintercept.c b/test/libmallocintercept.c index e789d34..61edbb8 100644 --- a/test/libmallocintercept.c +++ b/test/libmallocintercept.c @@ -24,7 +24,9 @@ #include static void print_msg(const char *msg) { - write(0, msg, strlen(msg)); + size_t out; + out = write(0, msg, strlen(msg)); + (void) out; /* unused */ } static void* actual_malloc(size_t size) {