[collectd] [PATCH] Fix gcc-4.4 strict-aliasing issue

Florian Forster octo at verplant.org
Fri Mar 6 19:21:14 CET 2009


Hi Alan,

On Tue, Mar 03, 2009 at 06:23:03PM +0100, apevec at gmail.com wrote:
> cc1: warnings being treated as errors
> liboping.c: In function 'ping_host_add':
> liboping.c:995: error: dereferencing pointer 'si' does break strict-aliasing rules

thank you very much for your patch :)

I have doubts about using the unions in that way though because I don't
quite see the advantage. I suspect `-fstrict-aliasing' will work when
using GCC on this file. Does the rest of collectd compile with
`-fstrict-aliasing'? I'd be surprised, to be honest, because I'm sure we
use similar casts in other places. Is that optimization turned on by
default when using GCC 4.4?

Regards,
-octo
-- 
Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
http://verplant.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20090306/726a3f5d/attachment.pgp 


More information about the collectd mailing list