]> git.droids-corp.org - dpdk.git/blobdiff - lib/librte_eal/common/include/rte_common.h
eal: ensure constness of container_of target
[dpdk.git] / lib / librte_eal / common / include / rte_common.h
index c4217082c9dd4c94e891ac048f769cdc9fb2d816..e057f6e2135575b9ebe1785d33f0137ed74c0d54 100644 (file)
@@ -348,6 +348,8 @@ rte_bsf32(uint32_t v)
 #ifndef container_of
 #define container_of(ptr, type, member)        __extension__ ({                \
                        const typeof(((type *)0)->member) *_ptr = (ptr); \
+                       __attribute__((unused)) type *_target_ptr =     \
+                               (type *)(ptr);                          \
                        (type *)(((uintptr_t)_ptr) - offsetof(type, member)); \
                })
 #endif