aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZack Weinberg <zack@wolery.cumb.org>2000-05-06 20:00:03 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-05-06 20:00:03 +0000
commit8784fdcd6948be709accc155dd11ec3b3294394d (patch)
tree6f7e2ff75e7f61fbe2cbff3e77a3c645d858d240
parentd44725ebf5cfe362e195c9f09e7e67dd02208759 (diff)
downloadgcc-8784fdcd6948be709accc155dd11ec3b3294394d.zip
gcc-8784fdcd6948be709accc155dd11ec3b3294394d.tar.gz
gcc-8784fdcd6948be709accc155dd11ec3b3294394d.tar.bz2
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
-rw-r--r--gcc/ChangeLog12
-rw-r--r--gcc/cpphash.h7
-rw-r--r--gcc/rtl.h10
-rw-r--r--gcc/tree.h8
-rw-r--r--gcc/varray.h2
-rw-r--r--include/ChangeLog5
-rw-r--r--include/ansidecl.h7
7 files changed, 34 insertions, 17 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index be9337f3..06f2531 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,15 @@
+2000-05-06 Zack Weinberg <zack@wolery.cumb.org>
+
+ * 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 16de5bb..925aac7 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 9148676..815cb0d 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 dcbdd9a..0bbf784 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 4e9b62f..ad0741a 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 438a770..3658cc4 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,8 @@
+2000-05-06 Zack Weinberg <zack@wolery.cumb.org>
+
+ * ansidecl.h: #define __extension__ to nothing if
+ GCC_VERSION < 2008.
+
2000-05-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* demangle.h (demangler_engine): Constify.
diff --git a/include/ansidecl.h b/include/ansidecl.h
index 9e8a457..e7852c6 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 */