When compiling with -std=c11, the typeof keyword in compat/atomics/gcc/stdatomic.h generates a compiler warning: implicit declaration of function ‘typeof’.
Using __typeof__ instead of typeof is recommended in https://gcc.gnu.org/onlinedocs/gcc/Typeof.html https://gcc.gnu.org/onlinedocs/gcc/Alternate-Keywords.html Signed-off-by: Wan-Teh Chang <w...@google.com> --- compat/atomics/gcc/stdatomic.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compat/atomics/gcc/stdatomic.h b/compat/atomics/gcc/stdatomic.h index 67168ab..1b65e80 100644 --- a/compat/atomics/gcc/stdatomic.h +++ b/compat/atomics/gcc/stdatomic.h @@ -100,8 +100,8 @@ do { \ #define atomic_exchange(object, desired) \ ({ \ - typeof(object) _obj = (object); \ - typeof(*object) _old; \ + __typeof__(object) _obj = (object); \ + __typeof__(*object) _old; \ do \ _old = atomic_load(_obj); \ while (!__sync_bool_compare_and_swap(_obj, _old, (desired))); \ @@ -113,8 +113,8 @@ do { \ #define atomic_compare_exchange_strong(object, expected, desired) \ ({ \ - typeof(object) _exp = (expected); \ - typeof(*object) _old = *_exp; \ + __typeof__(object) _exp = (expected); \ + __typeof__(*object) _old = *_exp; \ *_exp = __sync_val_compare_and_swap((object), _old, (desired)); \ *_exp == _old; \ }) -- 2.8.0.rc3.226.g39d4020 _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel