This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: chaser for cp-tree.h
Sure enough, it suffices to modify the CLASSTYPE_MARKED_N macros.
zw
* cp-tree.h (CLASSTYPE_MARKED_N, SET_CLASSTYPE_MARKED_N,
CLEAR_CLASSTYPE_MARKED_N): Cast signed side of ?: expression to
unsigned.
===================================================================
Index: cp-tree.h
--- cp-tree.h 1999/12/21 02:11:10 1.367
+++ cp-tree.h 1999/12/23 19:26:53
@@ -1335,24 +1335,26 @@ struct lang_type
? TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (NODE), 2) \
: NULL_TREE;
-/* Mark bits for depth-first and breath-first searches. */
+/* Mark bits for depth-first and breath-first searches.
+ The casts are because TYPE_ALIAS_SET is a signed int
+ while TYPE_LANG_SPECIFIC ->marks is unsigned. */
/* Get the value of the Nth mark bit. */
#define CLASSTYPE_MARKED_N(NODE, N) \
- (((CLASS_TYPE_P (NODE) ? TYPE_LANG_SPECIFIC (NODE)->marks \
- : TYPE_ALIAS_SET (NODE)) & (1 << N)) != 0)
+ (((CLASS_TYPE_P (NODE) ? TYPE_LANG_SPECIFIC (NODE)->marks \
+ : (unsigned) TYPE_ALIAS_SET (NODE)) & (1 << N)) != 0)
/* Set the Nth mark bit. */
#define SET_CLASSTYPE_MARKED_N(NODE, N) \
(CLASS_TYPE_P (NODE) \
- ? (TYPE_LANG_SPECIFIC (NODE)->marks |= (1 << (N))) \
- : (TYPE_ALIAS_SET (NODE) |= (1 << (N))))
+ ? (TYPE_LANG_SPECIFIC (NODE)->marks |= (1 << (N))) \
+ : (unsigned) (TYPE_ALIAS_SET (NODE) |= (1 << (N))))
/* Clear the Nth mark bit. */
#define CLEAR_CLASSTYPE_MARKED_N(NODE, N) \
(CLASS_TYPE_P (NODE) \
- ? (TYPE_LANG_SPECIFIC (NODE)->marks &= ~(1 << (N))) \
- : (TYPE_ALIAS_SET (NODE) &= ~(1 << (N))))
+ ? (TYPE_LANG_SPECIFIC (NODE)->marks &= ~(1 << (N))) \
+ : (unsigned) (TYPE_ALIAS_SET (NODE) &= ~(1 << (N))))
/* Get the value of the mark bits. */
#define CLASSTYPE_MARKED(NODE) CLASSTYPE_MARKED_N(NODE, 0)