From 8784fdcd6948be709accc155dd11ec3b3294394d Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Sat, 6 May 2000 20:00:03 +0000 Subject: [PATCH] cpphash.h: Remove conditional #define of __extension__. gcc: * cpphash.h: Remove conditional #define of __extension__. * rtl.h: Add __extension__ to RTL_CHECK1, RTL_CHECK2, RTL_CHECKC1, RTL_CHECKC2, and RTVEC_ELT macros (ENABLE_RTL_CHECKING only). * tree.h: Add __extension__ to TREE_CHECK, TREE_CLASS_CHECK, CST_OR_CONSTRUCTOR_CHECK, and EXPR_CHECK macros (ENABLE_TREE_CHECKING only). * varray.h: Add __extension__ to VARRAY_CHECK macro (ENABLE_CHECKING only). include: * ansidecl.h: #define __extension__ to nothing if GCC_VERSION < 2008. From-SVN: r33733 --- gcc/ChangeLog | 12 ++++++++++++ gcc/cpphash.h | 7 ------- gcc/rtl.h | 10 +++++----- gcc/tree.h | 8 ++++---- gcc/varray.h | 2 +- include/ChangeLog | 5 +++++ include/ansidecl.h | 7 +++++++ 7 files changed, 34 insertions(+), 17 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index be9337f39ad..06f25313db3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2000-05-06 Zack Weinberg + + * cpphash.h: Remove conditional #define of __extension__. + * rtl.h: Add __extension__ to RTL_CHECK1, RTL_CHECK2, + RTL_CHECKC1, RTL_CHECKC2, and RTVEC_ELT macros + (ENABLE_RTL_CHECKING only). + * tree.h: Add __extension__ to TREE_CHECK, TREE_CLASS_CHECK, + CST_OR_CONSTRUCTOR_CHECK, and EXPR_CHECK macros + (ENABLE_TREE_CHECKING only). + * varray.h: Add __extension__ to VARRAY_CHECK macro + (ENABLE_CHECKING only). + 2000-05-06 Richard Earnshaw (reanrsha@arm.com) Use new tail-calling mechanism on ARM. diff --git a/gcc/cpphash.h b/gcc/cpphash.h index 16de5bb1259..925aac7601f 100644 --- a/gcc/cpphash.h +++ b/gcc/cpphash.h @@ -25,13 +25,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ typedef unsigned char U_CHAR; #define U (const U_CHAR *) /* Intended use: U"string" */ -/* gcc 2.7.2 can't handle __extension__ const char array[] = { ... }. - I don't know when this was added - be conservative, assume it only - works in 2.95. */ -#if GCC_VERSION < 2095 -#define __extension__ -#endif - /* The structure of a node in the hash table. The hash table has entries for all tokens defined by #define commands (type T_MACRO), plus some special tokens like __LINE__ (these each have their own diff --git a/gcc/rtl.h b/gcc/rtl.h index 9148676726f..815cb0dc041 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -219,7 +219,7 @@ typedef struct rtvec_def{ #if defined ENABLE_RTL_CHECKING && (GCC_VERSION >= 2007) /* The bit with a star outside the statement expr and an & inside is so that N can be evaluated only once. */ -#define RTL_CHECK1(RTX, N, C1) \ +#define RTL_CHECK1(RTX, N, C1) __extension__ \ (*({ rtx _rtx = (RTX); int _n = (N); \ enum rtx_code _code = GET_CODE (_rtx); \ if (_n < 0 || _n >= GET_RTX_LENGTH (_code)) \ @@ -230,7 +230,7 @@ typedef struct rtvec_def{ __PRETTY_FUNCTION__); \ &_rtx->fld[_n]; })) -#define RTL_CHECK2(RTX, N, C1, C2) \ +#define RTL_CHECK2(RTX, N, C1, C2) __extension__ \ (*({ rtx _rtx = (RTX); int _n = (N); \ enum rtx_code _code = GET_CODE (_rtx); \ if (_n < 0 || _n >= GET_RTX_LENGTH (_code)) \ @@ -242,14 +242,14 @@ typedef struct rtvec_def{ __PRETTY_FUNCTION__); \ &_rtx->fld[_n]; })) -#define RTL_CHECKC1(RTX, N, C) \ +#define RTL_CHECKC1(RTX, N, C) __extension__ \ (*({ rtx _rtx = (RTX); int _n = (N); \ if (GET_CODE (_rtx) != C) \ rtl_check_failed_code1 (_rtx, C, __FILE__, __LINE__, \ __PRETTY_FUNCTION__); \ &_rtx->fld[_n]; })) -#define RTL_CHECKC2(RTX, N, C1, C2) \ +#define RTL_CHECKC2(RTX, N, C1, C2) __extension__ \ (*({ rtx _rtx = (RTX); int _n = (N); \ enum rtx_code _code = GET_CODE (_rtx); \ if (_code != C1 && _code != C2) \ @@ -257,7 +257,7 @@ typedef struct rtvec_def{ __PRETTY_FUNCTION__); \ &_rtx->fld[_n]; })) -#define RTVEC_ELT(RTVEC, I) \ +#define RTVEC_ELT(RTVEC, I) __extension__ \ (*({ rtvec _rtvec = (RTVEC); int _i = (I); \ if (_i < 0 || _i >= GET_NUM_ELEM (_rtvec)) \ rtvec_check_failed_bounds (_rtvec, _i, __FILE__, __LINE__, \ diff --git a/gcc/tree.h b/gcc/tree.h index dcbdd9a62c1..0bbf784e3c1 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -277,13 +277,13 @@ struct tree_common is accessed incorrectly. The macros abort with a fatal error. */ #if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007) -#define TREE_CHECK(t, code) \ +#define TREE_CHECK(t, code) __extension__ \ ({ const tree __t = t; \ if (TREE_CODE(__t) != (code)) \ tree_check_failed (__t, code, __FILE__, \ __LINE__, __PRETTY_FUNCTION__); \ __t; }) -#define TREE_CLASS_CHECK(t, class) \ +#define TREE_CLASS_CHECK(t, class) __extension__ \ ({ const tree __t = t; \ if (TREE_CODE_CLASS(TREE_CODE(__t)) != (class)) \ tree_class_check_failed (__t, class, __FILE__, \ @@ -291,14 +291,14 @@ struct tree_common __t; }) /* These checks have to be special cased. */ -#define CST_OR_CONSTRUCTOR_CHECK(t) \ +#define CST_OR_CONSTRUCTOR_CHECK(t) __extension__ \ ({ const tree __t = t; \ enum tree_code __c = TREE_CODE(__t); \ if (__c != CONSTRUCTOR && TREE_CODE_CLASS(__c) != 'c') \ tree_check_failed (__t, CONSTRUCTOR, __FILE__, \ __LINE__, __PRETTY_FUNCTION__); \ __t; }) -#define EXPR_CHECK(t) \ +#define EXPR_CHECK(t) __extension__ \ ({ const tree __t = t; \ char __c = TREE_CODE_CLASS(TREE_CODE(__t)); \ if (__c != 'r' && __c != 's' && __c != '<' \ diff --git a/gcc/varray.h b/gcc/varray.h index 4e9b62f8421..ad0741a305e 100644 --- a/gcc/varray.h +++ b/gcc/varray.h @@ -176,7 +176,7 @@ extern varray_type varray_grow PARAMS ((varray_type, size_t)); extern void varray_check_failed PARAMS ((varray_type, size_t, const char *, int, const char *)) ATTRIBUTE_NORETURN; -#define VARRAY_CHECK(VA, N, T) \ +#define VARRAY_CHECK(VA, N, T) __extension__ \ (*({ varray_type _va = VA; \ size_t _n = N; \ if (_n >= _va->num_elements) \ diff --git a/include/ChangeLog b/include/ChangeLog index 438a7703fad..3658cc4d4d1 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,8 @@ +2000-05-06 Zack Weinberg + + * ansidecl.h: #define __extension__ to nothing if + GCC_VERSION < 2008. + 2000-05-04 Kaveh R. Ghazi * demangle.h (demangler_engine): Constify. diff --git a/include/ansidecl.h b/include/ansidecl.h index 9e8a457c2e0..e7852c68458 100644 --- a/include/ansidecl.h +++ b/include/ansidecl.h @@ -222,4 +222,11 @@ So instead we use the macro below and test it against specific values. */ #define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6) #endif /* ATTRIBUTE_PRINTF */ +/* We use __extension__ in some places to suppress -pedantic warnings + about GCC extensions. This feature didn't work properly before + gcc 2.8. */ +#if GCC_VERSION < 2008 +#define __extension__ +#endif + #endif /* ansidecl.h */