From 0b51511b2f2139be93a7a4e7b3ac7683e0b85fc6 Mon Sep 17 00:00:00 2001 From: "Kaveh R. Ghazi" Date: Wed, 29 Aug 2007 02:34:22 +0000 Subject: system.h (CONST_CAST): Avoid union for gcc-4.0.x. * system.h (CONST_CAST): Avoid union for gcc-4.0.x. From-SVN: r127878 --- gcc/system.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gcc/system.h') diff --git a/gcc/system.h b/gcc/system.h index 46da3817d80..c9a1b6b0573 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -774,7 +774,9 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN; execv, et al. Another valid use would be in an allocation function that creates const objects that need to be initialized. Most other cases should be viewed with extreme caution. */ -#ifdef __GNUC__ + +#if defined(__GNUC__) && GCC_VERSION != 4000 +/* GCC 4.0.x has a bug where it may ICE on this expression. */ #define CONST_CAST(X) ((__extension__(union {__typeof(X)_q; void *_v;})(X))._v) #else #define CONST_CAST(X) ((void*)(X)) -- cgit v1.2.1