Getting rid of strict aliasing warnings

Bojan Smojver <[email protected]>
Newsgroups gmane.comp.apache.apreq
Message-ID <[email protected]>
I'm getting warnings about strict aliasing from GCC 4.3.0 and the
attached patch helped. Opinions?

-- 
Bojan
apreq-strict-aliasing-warning.patch (text/x-patch, 917 B)
Index: module/apache2/handle.c
===================================================================
--- module/apache2/handle.c	(revision 663420)
+++ module/apache2/handle.c	(working copy)
@@ -207,7 +207,7 @@
         h = ctx->find_param;
         h->next = ctx->parser->hook;
         ctx->parser->hook = h;
-        *(const char **)&h->ctx = name;
+        h->ctx = (void *)name;
 
         do {
             apreq_filter_prefetch(f, APREQ_DEFAULT_READ_BLOCK_SIZE);
Index: library/module_cgi.c
===================================================================
--- library/module_cgi.c	(revision 663420)
+++ library/module_cgi.c	(working copy)
@@ -474,7 +474,7 @@
         h = req->find_param;
         h->next = req->parser->hook;
         req->parser->hook = h;
-        *(const char **)&h->ctx = name;
+        h->ctx = (void *)name;
 
         do {
             cgi_read(handle, APREQ_DEFAULT_READ_BLOCK_SIZE);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.