[PATCH 2] fix broken strict aliasing

Brandon Black blblack at gmail.com
Sat Feb 20 16:44:00 CET 2010


On Sat, Feb 20, 2010 at 9:41 AM, Brandon Black <blblack at gmail.com> wrote:
>
> I've seen this strict-aliasing issues with libev + gcc 4.4 as well.  I
> haven't bothered to report it yet simply because I haven't had the
> time to sort out exactly what's going on, and whether it's a real
> issue that needs to be fixed, or as you've said, just an annoying
> bogus warning.  The newer versions of gcc are very aggressive about
> aliasing assumptions for optimization, and my hunch is that this is a
> real issue with newer gcc's that really care about strict aliasing,
> but it's just a hunch at this point.  I plan at some point in the next
> few days to dig into this in detail and sort it out for sure one way
> or the other.

I meant to add (but forgot): if anyone is really worried this could
cause a bug in your code in the short term, you can simply use
-fno-strict-aliasing when compiling libev, which will prevent the
compiler from making any bad aliasing assumptions about libev code.



More information about the libev mailing list