mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-08 14:05:19 +00:00
build: avoid type-punning in vbox
Commit 78345c68
makes at least gcc 4.1.2 on RHEL 5 complain:
cc1: warnings being treated as errors
In file included from vbox/vbox_V4_0.c:13:
vbox/vbox_tmpl.c: In function 'vboxDomainUndefineFlags':
vbox/vbox_tmpl.c:5298: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
* src/vbox/vbox_tmpl.c (vboxDomainUndefineFlags): Use union to
avoid compiler warning.
This commit is contained in:
parent
e3f725a171
commit
834bb44834
@ -5294,8 +5294,11 @@ vboxDomainUndefineFlags(virDomainPtr dom, unsigned int flags)
|
|||||||
|
|
||||||
((IMachine_Delete)machine->vtbl->Delete)(machine, &safeArray, &progress);
|
((IMachine_Delete)machine->vtbl->Delete)(machine, &safeArray, &progress);
|
||||||
# else
|
# else
|
||||||
vboxArray array = VBOX_ARRAY_INITIALIZER;
|
union {
|
||||||
machine->vtbl->Delete(machine, 0, (IMedium**)&array, &progress);
|
vboxArray array;
|
||||||
|
IMedium *medium;
|
||||||
|
} u = { .array = VBOX_ARRAY_INITIALIZER };
|
||||||
|
machine->vtbl->Delete(machine, 0, &u.medium, &progress);
|
||||||
# endif
|
# endif
|
||||||
if (progress != NULL) {
|
if (progress != NULL) {
|
||||||
progress->vtbl->WaitForCompletion(progress, -1);
|
progress->vtbl->WaitForCompletion(progress, -1);
|
||||||
|
Loading…
Reference in New Issue
Block a user