From 81d73ce417dda6a98e2e918e06922e68b67c53f7 Mon Sep 17 00:00:00 2001 From: PatR Date: Tue, 18 Dec 2018 19:11:36 -0800 Subject: [PATCH] disable gcc's __attribute__((warn_unused_result)) Casting to (void) to discard a function return value doesn't satisfy gcc's -Wunused-result (which we aren't enabling but is apparently being activated for particular functions by glibc header files). Turn it into a no-op to suppress three dozen warnings from Travis builds. --- include/tradstdc.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/tradstdc.h b/include/tradstdc.h index d1b1f250c..e6a8f3e8f 100644 --- a/include/tradstdc.h +++ b/include/tradstdc.h @@ -405,6 +405,10 @@ typedef genericptr genericptr_t; /* (void *) or (char *) */ #if __GNUC__ >= 3 #define UNUSED __attribute__((unused)) #define NORETURN __attribute__((noreturn)) +/* disable gcc's __attribute__((__warn_unused_result__)) since explicitly + discarding the result by casting to (void) is not accepted as a 'use' */ +#define __warn_unused_result__ /*empty*/ +#define warn_unused_result /*empty*/ #endif #endif