From 5c5fbd9bf0a62d3398d9c6f3fbc6540865cf2f83 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Sat, 5 Aug 2017 19:26:50 +0200 Subject: [PATCH] Remove warnings for some compilers. --- m-i-shared.h | 6 ++++-- m-shared.h | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/m-i-shared.h b/m-i-shared.h index 99e321bc..bd0c64da 100644 --- a/m-i-shared.h +++ b/m-i-shared.h @@ -86,8 +86,10 @@ static inline type * \ M_C(name, _init_set)(type *shared) \ { \ - if (shared != NULL) \ - atomic_fetch_add(&(shared->M_C(name, _cpt)), 1); \ + if (shared != NULL) { \ + int n = atomic_fetch_add(&(shared->M_C(name, _cpt)), 1); \ + (void) n; \ + } \ return shared; \ } \ \ diff --git a/m-shared.h b/m-shared.h index 02242c22..d642c865 100644 --- a/m-shared.h +++ b/m-shared.h @@ -136,8 +136,10 @@ SHAREDI_CONTRACT(shared); \ assert (dest != shared); \ *dest = *shared; \ - if (*dest != NULL) \ - atomic_fetch_add(&((*dest)->cpt), 1); \ + if (*dest != NULL) { \ + int n = atomic_fetch_add(&((*dest)->cpt), 1); \ + (void) n; /* unused return value */ \ + } \ SHAREDI_CONTRACT(dest); \ } \ \