]> git.ipfire.org Git - thirdparty/libvirt.git/commit
build: avoid ATTRIBUTE_UNUSED in headers
authorEric Blake <eblake@redhat.com>
Fri, 8 Jul 2011 21:58:28 +0000 (15:58 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 14 Jul 2011 13:51:30 +0000 (07:51 -0600)
commit088473b29f2169d4dabfbc7ccdf085cd964943a3
tree3e3862f9b5bd9e3d5d465c2a73bdac288bfd5e7d
parent3349f2bb655262ed59032a45c1e9f1b51c2a8db7
build: avoid ATTRIBUTE_UNUSED in headers

The compiler might optimize based on our declaration that something
is unused.  Putting that declaration in the header risks getting
out of sync with the actual implementation, so it belongs better
only in the .c files.  We were mostly compliant, and a new syntax
check will help us in the future.

* cfg.mk (sc_avoid_attribute_unused_in_header): New syntax check.
* src/nodeinfo.h (nodeGetCPUStats, nodeGetMemoryStats): Delete
attribute already present in .c file.
* src/qemu/qemu_domain.h (qemuDomainEventFlush): Likewise.
* src/util/virterror_internal.h (virReportErrorHelper): Parameters
are actually used by .c file.
* src/xenxs/xen_sxpr.h (xenFormatSxprDisk): Adjust prototype.
* src/xenxs/xen_sxpr.c (xenFormatSxprDisk): Delete unused argument.
(xenFormatSxpr): Adjust caller.
* src/xen/xend_internal.c (xenDaemonAttachDeviceFlags)
(xenDaemonUpdateDeviceFlags): Likewise.
Suggested by Daniel Veillard.
cfg.mk
src/nodeinfo.h
src/qemu/qemu_domain.h
src/util/virterror_internal.h
src/xen/xend_internal.c
src/xenxs/xen_sxpr.c
src/xenxs/xen_sxpr.h