On Sat, 2008-05-31 at 17:36 +1000, Bojan Smojver wrote:
> And just a note that we still get these:
> -------------------------
> poll/unix/epoll.c: In function 'apr_pollset_add':
> poll/unix/epoll.c:184: warning: dereferencing type-punned pointer will
> break strict-aliasing rules
This patch avoids the warning for me. Not sure if it makes any sense at
all...
--
Bojan
Index: include/apr_ring.h
===================================================================
--- include/apr_ring.h (revision 662126)
+++ include/apr_ring.h (working copy)
@@ -156,8 +156,16 @@
* @param elem The name of the element struct
* @param link The name of the APR_RING_ENTRY in the element struct
*/
+#if APR_HAS_INLINE
+static APR_INLINE char *apr_ring_head(void *hp) {
+ return (char *)hp;
+}
#define APR_RING_SENTINEL(hp, elem, link) \
+ (struct elem *)(apr_ring_head((hp) - APR_OFFSETOF(struct elem, link)))
+#else
+#define APR_RING_SENTINEL(hp, elem, link) \
(struct elem *)((char *)(hp) - APR_OFFSETOF(struct elem, link))
+#endif
/**
* The first element of the ring