Commit 68ed90d8 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Fix warnings in the RTS

For some reason this causes build failures for me in my 32-bit chroot,
parent a7d2d334
...@@ -407,9 +407,12 @@ ...@@ -407,9 +407,12 @@
#define BITMAP_BITS(bitmap) ((bitmap) >> BITMAP_BITS_SHIFT) #define BITMAP_BITS(bitmap) ((bitmap) >> BITMAP_BITS_SHIFT)
/* Debugging macros */ /* Debugging macros */
#define LOOKS_LIKE_INFO_PTR(p) \ #define LOOKS_LIKE_INFO_PTR(p) \
((p) != NULL && \ ((p) != NULL && \
(TO_W_(%INFO_TYPE(%STD_INFO(p))) != INVALID_OBJECT) && \ LOOKS_LIKE_INFO_PTR_NOT_NULL(p))
#define LOOKS_LIKE_INFO_PTR_NOT_NULL(p) \
( (TO_W_(%INFO_TYPE(%STD_INFO(p))) != INVALID_OBJECT) && \
(TO_W_(%INFO_TYPE(%STD_INFO(p))) < N_CLOSURE_TYPES)) (TO_W_(%INFO_TYPE(%STD_INFO(p))) < N_CLOSURE_TYPES))
#define LOOKS_LIKE_CLOSURE_PTR(p) (LOOKS_LIKE_INFO_PTR(GET_INFO(UNTAG(p)))) #define LOOKS_LIKE_CLOSURE_PTR(p) (LOOKS_LIKE_INFO_PTR(GET_INFO(UNTAG(p))))
......
...@@ -304,7 +304,10 @@ void dirty_MUT_VAR(StgRegTable *reg, StgClosure *p); ...@@ -304,7 +304,10 @@ void dirty_MUT_VAR(StgRegTable *reg, StgClosure *p);
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
#define LOOKS_LIKE_INFO_PTR(p) \ #define LOOKS_LIKE_INFO_PTR(p) \
(p && ((StgInfoTable *)(INFO_PTR_TO_STRUCT(p)))->type != INVALID_OBJECT && \ (p && LOOKS_LIKE_INFO_PTR_NOT_NULL(p))
#define LOOKS_LIKE_INFO_PTR_NOT_NULL(p) \
(((StgInfoTable *)(INFO_PTR_TO_STRUCT(p)))->type != INVALID_OBJECT && \
((StgInfoTable *)(INFO_PTR_TO_STRUCT(p)))->type < N_CLOSURE_TYPES) ((StgInfoTable *)(INFO_PTR_TO_STRUCT(p)))->type < N_CLOSURE_TYPES)
#define LOOKS_LIKE_CLOSURE_PTR(p) \ #define LOOKS_LIKE_CLOSURE_PTR(p) \
......
...@@ -116,7 +116,8 @@ initStorage( void ) ...@@ -116,7 +116,8 @@ initStorage( void )
/* Sanity check to make sure the LOOKS_LIKE_ macros appear to be /* Sanity check to make sure the LOOKS_LIKE_ macros appear to be
* doing something reasonable. * doing something reasonable.
*/ */
ASSERT(LOOKS_LIKE_INFO_PTR(&stg_BLACKHOLE_info)); /* We use the NOT_NULL variant or gcc warns that the test is always true */
ASSERT(LOOKS_LIKE_INFO_PTR_NOT_NULL(&stg_BLACKHOLE_info));
ASSERT(LOOKS_LIKE_CLOSURE_PTR(&stg_dummy_ret_closure)); ASSERT(LOOKS_LIKE_CLOSURE_PTR(&stg_dummy_ret_closure));
ASSERT(!HEAP_ALLOCED(&stg_dummy_ret_closure)); ASSERT(!HEAP_ALLOCED(&stg_dummy_ret_closure));
......
Supports Markdown
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