diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-10-05 09:37:44 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-10-05 13:41:07 +0200 |
commit | 4a7c68675d26990b6d28b9820b837322e2b234a2 (patch) | |
tree | 74bcf62522bb72acd5e3559877724806d6adf1e2 | |
parent | score: Fix legacy RTEMS_STATIC_ASSERT() (diff) | |
download | rtems-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.
-rw-r--r-- | cpukit/include/linux/rbtree.h | 4 |
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 \ ); \ |