[PATCH] fix strict aliasing error on ubuntu 10.04

Martin Schwenke martin at meltin.net
Tue Jul 19 02:40:20 UTC 2016

On Tue, 19 Jul 2016 01:38:23 +0200, Michael Adam <obnox at samba.org>

> Comments?
> On 2016-07-14 at 11:36 +0200, Michael Adam wrote:
> > Trying to fix the samba-o3 autobuild target on
> > the 104 test host. There are several errors of type
> > "dereferencing pointer breaks strict aliasing rules".
> > Mostly for socket related structures.
> > 
> > For this one, there was already an attempt to fix it, but
> > it did not work out, apparently:
> > 
> > 2a5183f49efc1d407ed36c457d8a953e1363eb42
> > 
> > I only seem to get away with memcpy for this one.
> > If someone has a better patch, I'm all ears...

I'll bite...  but please take this with a grain of salt because I'm
especially grumpy at the moment...  :-)

The compiler in Ubuntu 10.04 had a bug.  The bug has since been fixed
and more recent compilers do not issue the warning.  Ubuntu 10.04's
end-of-life date was 2015-04-30 (https://wiki.ubuntu.com/Releases).

I don't think we should be working around a compiler bug in an
operating system that nobody should be running, especially when the
work-around makes the code less efficient.

If this is stopping autobuilds on sn-devel-104 and that is important
then we should consider adding -Wno-error=strict-aliasing or similar
until the problem goes away...

I said I was feeling grumpy!  ;-)

peace & happiness,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160719/6fdd57e5/attachment.sig>

More information about the samba-technical mailing list