]> xenbits.xensource.com Git - libvirt.git/commit
build: fix type-punning bug
authorEric Blake <eblake@redhat.com>
Fri, 26 Oct 2012 18:53:45 +0000 (12:53 -0600)
committerEric Blake <eblake@redhat.com>
Fri, 26 Oct 2012 19:00:27 +0000 (13:00 -0600)
commit246143b69f9dee307a1d4c26f5c793fc2d10a932
treedd5c09729d96c2079739f2f4267504f52e0e8f1b
parent73ebd86d7318960b22c3b0f1262cbbd770265c9c
build: fix type-punning bug

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 I couldn't get newer
gcc to report the same warning message.

* src/rpc/virnetserverservice.c
(virNetServerServiceNewPostExecRestart): Use temporary instead.
src/rpc/virnetserverservice.c