On 12/12/2013 10:05 AM, Michele Paolino wrote:
With the changes added by the latest commits (e.g.
8a29ffcf9aee45b61a0a12ee45c656cfd52333e8) related to "new events feature
v2",
we are unable to compile libvirt on ARM target (OMAP5).
The error is due to alignment:
conf/domain_event.c: In function 'virDomainEventDispatchDefaultFunc':
conf/domain_event.c:1198:30: error: cast increases required alignment of
target type [-Werror=cast-align]
conf/domain_event.c:1314:34: error: cast increases required alignment of
target type [-Werror=cast-align]
cc1: all warnings being treated as errors
Using ATTRIBUTE_PACKED we force a structure to not follow architecture and
compiler best alignments.
NACK; I'd rather go with the union approach, because ATTRIBUTE_PACKED
risks putting things on non-clean boundaries which may then interfere
with attempts to do atomic operations on fields that a subclass may add.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org