From eb7ed711a0dfcf7ac799998d004141867a57bb0e Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Sat, 30 Jun 2018 22:31:13 +0300 Subject: [PATCH] Eliminate 'language extension used' Clang warning in gc.h * include/gc.h [GC_DEBUG && __GNUC__] (GC_PTR_ADD, GC_PRE_INCR, GC_POST_INCR, GC_POST_DECR): Replace typeof to __typeof__. --- include/gc.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/gc.h b/include/gc.h index 72fc0448..8eedc772 100644 --- a/include/gc.h +++ b/include/gc.h @@ -1427,10 +1427,10 @@ GC_API void GC_CALL GC_dump(void); ((type_of_result)GC_pre_incr((void **)(&(x)), (n)*sizeof(*x))) # define GC_POST_INCR3(x, n, type_of_result) \ ((type_of_result)GC_post_incr((void **)(&(x)), (n)*sizeof(*x))) -# define GC_PTR_ADD(x, n) GC_PTR_ADD3(x, n, typeof(x)) -# define GC_PRE_INCR(x, n) GC_PRE_INCR3(x, n, typeof(x)) -# define GC_POST_INCR(x) GC_POST_INCR3(x, 1, typeof(x)) -# define GC_POST_DECR(x) GC_POST_INCR3(x, -1, typeof(x)) +# define GC_PTR_ADD(x, n) GC_PTR_ADD3(x, n, __typeof__(x)) +# define GC_PRE_INCR(x, n) GC_PRE_INCR3(x, n, __typeof__(x)) +# define GC_POST_INCR(x) GC_POST_INCR3(x, 1, __typeof__(x)) +# define GC_POST_DECR(x) GC_POST_INCR3(x, -1, __typeof__(x)) #else /* !GC_DEBUG || !__GNUC__ */ /* We can't do this right without typeof, which ANSI decided was not */ /* sufficiently useful. Without it we resort to the non-debug version. */ -- 2.40.0