From: Paul F. <pa...@so...> - 2024-11-23 08:16:25
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=bc0571549e426b5b71387fe3ab01fe0c4a4af4b3 commit bc0571549e426b5b71387fe3ab01fe0c4a4af4b3 Author: Paul Floyd <pj...@wa...> Date: Sat Nov 23 08:14:15 2024 +0100 Turn off unused result warnings Diff: --- Makefile.all.am | 1 + helgrind/hg_intercepts.c | 20 ++++---------------- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/Makefile.all.am b/Makefile.all.am index dcea2690eb..e221198d6c 100755 --- a/Makefile.all.am +++ b/Makefile.all.am @@ -104,6 +104,7 @@ AM_CFLAGS_BASE = \ -Wpointer-arith \ -Wstrict-prototypes \ -Wmissing-declarations \ + -Wno-unused-result \ @FLAG_W_CAST_ALIGN@ \ @FLAG_W_CAST_QUAL@ \ @FLAG_W_WRITE_STRINGS@ \ diff --git a/helgrind/hg_intercepts.c b/helgrind/hg_intercepts.c index ac2449e609..950d71b83c 100644 --- a/helgrind/hg_intercepts.c +++ b/helgrind/hg_intercepts.c @@ -978,10 +978,7 @@ static int mutex_lock_WRK(pthread_mutex_t *mutex) if (TRACE_PTH_FNS) { char buf[30]; snprintf(buf, 30, "<< pthread_mxlock %p", mutex); -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-result" - write(STDERR_FILENO, buf, strlen(buf)); -#pragma GCC diagnostic pop + (void)write(STDERR_FILENO, buf, strlen(buf)); fsync(STDERR_FILENO); } @@ -1017,10 +1014,7 @@ HG_MUTEX_LOCK_OUT: if (TRACE_PTH_FNS) { char buf[30]; snprintf(buf, 30, " :: mxlock -> %d >>\n", ret); -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-result"1251 - write(STDERR_FILENO, buf, strlen(buf)); -#pragma GCC diagnostic pop + (void)write(STDERR_FILENO, buf, strlen(buf)); } return ret; } @@ -1248,10 +1242,7 @@ static int mutex_unlock_WRK(pthread_mutex_t *mutex) if (TRACE_PTH_FNS) { char buf[30]; snprintf(buf, 30, "<< pthread_mxunlk %p", mutex); -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-result" - write(STDERR_FILENO, buf, strlen(buf)); -#pragma GCC diagnostic pop + (void)write(STDERR_FILENO, buf, strlen(buf)); fsync(STDERR_FILENO); } @@ -1270,10 +1261,7 @@ static int mutex_unlock_WRK(pthread_mutex_t *mutex) if (TRACE_PTH_FNS) { char buf[30]; snprintf(buf, 30, " :: mxunlk -> %d >>\n", ret); -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-result" - write(STDERR_FILENO, buf, strlen(buf)); -#pragma GCC diagnostic pop + (void)write(STDERR_FILENO, buf, strlen(buf)); } return ret; } |