apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bojan Smojver <bo...@rexursive.com>
Subject Re: 0.9 util puzzle
Date Tue, 14 Jul 2009 01:32:22 GMT
On Mon, 2009-07-13 at 20:26 -0500, William A. Rowe, Jr. wrote:
> Why are all my APR_BRIGADE_INSERT_HEAD(b, eos); and similar statements
> now causing;
> 
> ftp_request.c:76: warning: dereferencing type-punned pointer will
> break
> strict-aliasing rules
> ftp_request.c:76: warning: dereferencing type-punned pointer will
> break
> strict-aliasing rules
> ftp_request.c:76: warning: dereferencing type-punned pointer will
> break
> strict-aliasing rules
> 
> That's awfully noisy!

I don't think we ever addressed that in apr_ring.h of APR 0.9. Part of
the diff between 1.3 and 0.0 below:
---------------------------------------------------
--- include/apr_ring.h  2008-06-03 10:05:55.000000000 +1000
+++ ../../0.9.x/apr/include/apr_ring.h  2007-09-01 18:27:11.000000000 +1000
@@ -69,8 +69,8 @@
  */
 #define APR_RING_ENTRY(elem)                                           \
     struct {                                                           \
-       struct elem * volatile next;                                    \
-       struct elem * volatile prev;                                    \
+       struct elem *next;                                              \
+       struct elem *prev;                                              \
     }
 
 /**
@@ -90,8 +90,8 @@
  */
 #define APR_RING_HEAD(head, elem)                                      \
     struct head {                                                      \
-       struct elem *next;                                              \
-       struct elem *prev;                                              \
+       struct elem * volatile next;                                    \
+       struct elem * volatile prev;                                    \
     }
 
 /**
@@ -157,7 +157,7 @@
  * @param link The name of the APR_RING_ENTRY in the element struct
  */
 #define APR_RING_SENTINEL(hp, elem, link)                              \
-    (struct elem *)((char *)(&(hp)->next) - APR_OFFSETOF(struct elem, link))
+    (struct elem *)((char *)(hp) - APR_OFFSETOF(struct elem, link))
 
 /**
  * The first element of the ring
---------------------------------------------------

-- 
Bojan


Mime
View raw message