From be520f975a3906809e3db6e4fa7f0497db172097 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Thu, 6 May 2021 19:25:32 +0200 Subject: [PATCH] newlib: stdatomic: fix prototypes, don't disable compiler warnings --- components/newlib/stdatomic.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/components/newlib/stdatomic.c b/components/newlib/stdatomic.c index a58b203ccd..771bfd030c 100644 --- a/components/newlib/stdatomic.c +++ b/components/newlib/stdatomic.c @@ -82,7 +82,7 @@ return ret; \ } -#define CMP_EXCHANGE(n, type) bool __atomic_compare_exchange_ ## n (type* mem, type* expect, type desired, int success, int failure) \ +#define CMP_EXCHANGE(n, type) bool __atomic_compare_exchange_ ## n (type* mem, type* expect, type desired, bool weak, int success, int failure) \ { \ bool ret = false; \ unsigned state = _ATOMIC_ENTER_CRITICAL(); \ @@ -141,12 +141,12 @@ return ret; \ } -#define SYNC_FETCH_OP(op, n, type) type __sync_fetch_and_ ## op ##_ ## n (type* ptr, type value, ...) \ +#define SYNC_FETCH_OP(op, n, type) type __sync_fetch_and_ ## op ##_ ## n (type* ptr, type value) \ { \ return __atomic_fetch_ ## op ##_ ## n (ptr, value, __ATOMIC_SEQ_CST); \ } -#define SYNC_BOOL_CMP_EXCHANGE(n, type) bool __sync_bool_compare_and_swap_ ## n (type *ptr, type oldval, type newval, ...) \ +#define SYNC_BOOL_CMP_EXCHANGE(n, type) bool __sync_bool_compare_and_swap_ ## n (type *ptr, type oldval, type newval) \ { \ bool ret = false; \ unsigned state = _ATOMIC_ENTER_CRITICAL(); \ @@ -158,7 +158,7 @@ return ret; \ } -#define SYNC_VAL_CMP_EXCHANGE(n, type) type __sync_val_compare_and_swap_ ## n (type *ptr, type oldval, type newval, ...) \ +#define SYNC_VAL_CMP_EXCHANGE(n, type) type __sync_val_compare_and_swap_ ## n (type *ptr, type oldval, type newval) \ { \ unsigned state = _ATOMIC_ENTER_CRITICAL(); \ type ret = *ptr; \ @@ -169,8 +169,6 @@ return ret; \ } -#pragma GCC diagnostic ignored "-Wbuiltin-declaration-mismatch" - #if NO_ATOMICS_SUPPORT ATOMIC_EXCHANGE(1, uint8_t)