From: Paul Floyd Date: Sat, 23 Nov 2024 07:14:15 +0000 (+0100) Subject: Turn off unused result warnings X-Git-Tag: VALGRIND_3_25_0~227 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc0571549e426b5b71387fe3ab01fe0c4a4af4b3;p=thirdparty%2Fvalgrind.git Turn off unused result warnings --- diff --git a/Makefile.all.am b/Makefile.all.am index dcea2690e..e221198d6 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 ac2449e60..950d71b83 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; }