
On 07/12/2011 10:04 AM, Daniel P. Berrange wrote:
Any thoughts on this patch
Regards, Daniel
On Mon, Jul 04, 2011 at 01:48:16PM +0100, Daniel P. Berrange wrote:
I'm only 80% convinced that this patch is a good idea because in some cases I'm not entirely happy about commenting out macros that may well be used in the near future. On the plus side it has identified a reasonable number of unused legacy crufty macros
I'm also not convinced on whether to turn it on by default. It seems like it has a rather high a risk of false positives.
This enables the -Wunused-macros GCC flag to identify historical macros which are no longer used due to code refactoring.
* m4/virt-compile-warnings.m4: Enable -Wunused-macros * daemon/libvirtd.c: Remove MAX_LISTEN * daemon/remote.c: Remove VIR_FROM_THIS * examples/domain-events/events-c/event-test.c: Remove VIR_DEBUG * python/libvirt-override.c: Put NAME() inside DEBUG_ERROR * src/esx/esx*.c: Comment out unused VIR_FROM_THIS * src/node_device/node_device_hal.c: Remove pointless macros for accessing privateData * src/openvz/openvz_driver.c: Remove CMDBUF_LEN/CMDOP_LEN * src/qemu/qemu_monitor_text.c: Remove QEMU_CMD_PROMPT and QEMU_PASSWD_PROMPT * src/remote/remote_driver.c: Remove UNIX_PATH_MAX * src/security/security_stack.c: Remove VIR_FROM_THIS * src/uml/uml_conf.c: Remove umlLog() * src/uml/uml_driver.c: Remove TEMPDIR * src/util/bridge.c: Remove JIFFIES_TO_MS/MS_TO_JIFFIES * src/util/hooks.c: Ensure VIR_FROM_THIS is used * src/util/logging.c: Remove VIR_FROM_THIS * src/util/macvtap.c: Disable unused constants * src/util/storage_file.c: Disable QCOW1_HDR_TOTAL_SIZE * src/vbox/vbox_driver.c: Remove duplicated VIR_FROM_THIS and make sure it is used * src/util/pci.c: Disable some unused constants * src/xen/xen_hypervisor.c: Remove XEN_V0_IOCTL_HYPERCALL_CMD and unused DOMFLAGS_CPUMASK/DOMFLAGS_CPUSHIFT * src/xen/xm_internal.c: Remove XM_XML_ERROR, XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU and XEND_CONFIG_MIN_VERS_PVFB_NEWCONF * tools/virsh.c: Remove DIR_MODE/LOCK_MODE, LVL_NOTICE constants * tests/sockettest.c: Remove DO_TEST_PARSE
I haven't looked through this patch yet, but it seems like most of the hunks would be obviously good to make, even if we decide not to enable -Wunused-macros. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org