[rtems commit] Fix rbtree_postorder_for_each_entry_safe()
Sebastian Huber
sebh at rtems.org
Mon Oct 8 05:15:56 UTC 2018
Module: rtems
Branch: master
Commit: 4a7c68675d26990b6d28b9820b837322e2b234a2
Changeset: http://git.rtems.org/rtems/commit/?id=4a7c68675d26990b6d28b9820b837322e2b234a2
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Fri Oct 5 09:37:44 2018 +0200
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.
---
cpukit/include/linux/rbtree.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cpukit/include/linux/rbtree.h b/cpukit/include/linux/rbtree.h
index 53c777e..8fc5752 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 \
); \
More information about the vc
mailing list