Commit 0b51511b by Kaveh R. Ghazi Committed by Kaveh Ghazi

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
parent 5d75fb81
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> 2007-08-28 Richard Guenther <rguenther@suse.de>
* tree.h (struct tree_function_decl): Increase size of * tree.h (struct tree_function_decl): Increase size of
......
...@@ -774,7 +774,9 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN; ...@@ -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 execv, et al. Another valid use would be in an allocation function
that creates const objects that need to be initialized. Most other that creates const objects that need to be initialized. Most other
cases should be viewed with extreme caution. */ 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) #define CONST_CAST(X) ((__extension__(union {__typeof(X)_q; void *_v;})(X))._v)
#else #else
#define CONST_CAST(X) ((void*)(X)) #define CONST_CAST(X) ((void*)(X))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment