diff options
author | Kaveh R. Ghazi <ghazi@caip.rutgers.edu> | 2007-08-29 02:34:22 +0000 |
---|---|---|
committer | Kaveh Ghazi <ghazi@gcc.gnu.org> | 2007-08-29 02:34:22 +0000 |
commit | 0b51511b2f2139be93a7a4e7b3ac7683e0b85fc6 (patch) | |
tree | 127f5cfecd314cb9b92c78ecd9d78879e37671e7 | |
parent | 5d75fb81c78587a26eea95e482c18418389d19b9 (diff) | |
download | gcc-0b51511b2f2139be93a7a4e7b3ac7683e0b85fc6.zip gcc-0b51511b2f2139be93a7a4e7b3ac7683e0b85fc6.tar.gz gcc-0b51511b2f2139be93a7a4e7b3ac7683e0b85fc6.tar.bz2 |
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
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/system.h | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d9724f8..7b738c0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2007-08-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> + + * system.h (CONST_CAST): Avoid union for gcc-4.0.x. + 2007-08-28 Richard Guenther <rguenther@suse.de> * tree.h (struct tree_function_decl): Increase size of diff --git a/gcc/system.h b/gcc/system.h index 46da381..c9a1b6b 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)) |