[Libvir] remove global variables from header files
Daniel Veillard
veillard at redhat.com
Mon Mar 19 14:21:31 UTC 2007
On Mon, Mar 19, 2007 at 02:46:05PM +0100, Jim Meyering wrote:
> Hello,
>
> I compiled the latest-from-cvs libvirt and was surprised to
> see link failures. It was because I used -fno-common:
>
> .libs/libvirt_la-hash.o:(.bss+0x0): multiple definition of `virDomainFlags'
> .libs/libvirt_la-libvirt.o:(.bss+0x0): first defined here
>
> libvirt_qemud-buf.o:(.bss+0x0): multiple definition of `qemud_packet_type'
> libvirt_qemud-qemud.o:(.bss+0x0): first defined here
> libvirt_qemud-buf.o:(.bss+0x4): multiple definition of `qemud_domain_runstate'
> libvirt_qemud-qemud.o:(.bss+0x4): first defined here
>
> Those happen when more than one compilation unit contains a non-extern
> declaration of the same global variable.
>
> In each of the three cases, the name in question appears only
> at the point of declaration, so one could conceivably simply
> remove the name, leaving the anonymous "enum". But then there
> would be no way to declare a variable to be of that type, so
> I chose to reuse the name, making it the name of the enum.
> If name space pollution is an issue, and applications that use
> those headers won't need those types, then it'd be better to
> remove the names altogether.
Yes, makes sense, applied and commited,
thanks a lot !
Daniel
--
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard | virtualization library http://libvirt.org/
veillard at redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
More information about the libvir-list
mailing list