From: Ivan Maidanski Date: Sat, 30 Jun 2018 19:31:13 +0000 (+0300) Subject: Eliminate 'language extension used' Clang warning in gc.h X-Git-Tag: v8.0.0~91 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c6107dca026f023f96af3f66f465a0727389ff7c;p=gc 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__. --- diff --git a/include/gc.h b/include/gc.h index 24232793..cfe9f6bf 100644 --- a/include/gc.h +++ b/include/gc.h @@ -1612,10 +1612,10 @@ GC_API void GC_CALL GC_dump_finalization(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. */