Re: [libvirt] one more warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Oct 27, 2008 at 07:49:17PM +0100, Jim Meyering wrote:
> One more warning question:
> Compiling with all storage backends disabled, I get this:
> 
> storage_backend.c:91: warning: comparison of unsigned expression < 0 is always false
> 
[...]
> The above loses because ARRAY_CARDINALITY(backends) is 0.
> 
[...]
> Another way is to add a NULL pointer at the end
> and change the loop not to use the array size at all:
> 
>     for (i = 0; backends[i]; i++)
>         if (backends[i]->type == type)
>             return backends[i];
> 
> I chose the latter:

  yup, sounds better to me too,

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel@xxxxxxxxxxxx  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]