summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-10-05 09:37:44 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-10-05 13:41:07 +0200
commit4a7c68675d26990b6d28b9820b837322e2b234a2 (patch)
tree74bcf62522bb72acd5e3559877724806d6adf1e2 /cpukit
parentscore: Fix legacy RTEMS_STATIC_ASSERT() (diff)
downloadrtems-4a7c68675d26990b6d28b9820b837322e2b234a2.tar.bz2
Fix rbtree_postorder_for_each_entry_safe()
Use the non-standard typeof operator to avoid code generation errors with clang and use of uninitialized variable warnings with GCC and Coverity Scan. Update #3465.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/include/linux/rbtree.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/cpukit/include/linux/rbtree.h b/cpukit/include/linux/rbtree.h
index 53c777e8c1..8fc575240f 100644
--- a/cpukit/include/linux/rbtree.h
+++ b/cpukit/include/linux/rbtree.h
@@ -126,12 +126,12 @@ static inline struct rb_node *rb_parent( struct rb_node *node )
for ( \
node = _RBTree_Postorder_first( \
(RBTree_Control *) root, \
- (size_t) ( (char *) &node->field - (char *) node ) \
+ offsetof( __typeof__( *node ), field ) \
); \
node != NULL && ( \
next = _RBTree_Postorder_next( \
&node->field, \
- (size_t) ( (char *) &node->field - (char *) node ) \
+ offsetof( __typeof__( *node ), field ) \
), \
node != NULL \
); \