[libvirt] [PATCH] build: fix type-punning bug

Eric Blake eblake at redhat.com
Fri Oct 26 19:05:43 UTC 2012


On 10/26/2012 12:58 PM, Eric Blake wrote:
> With older gcc and 64-bit size_t, the compiler issues a real warning:
> rpc/virnetserverservice.c:277: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
> 
> Introduced in commit 0cc79255.  Depending on machine endianness,
> this warning represents a real bug that could mis-interpret the
> value by a factor of 2^32.  I don't know why newer gcc didn't
> bother to warn.
> 
> * src/rpc/virnetserverservice.c
> (virNetServerServiceNewPostExecRestart): Use temporary instead.
> ---
>  src/rpc/virnetserverservice.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

Pushed under the build-breaker rule.

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 617 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20121026/860c4d5a/attachment-0001.sig>


More information about the libvir-list mailing list