[libvirt] [PATCH] build: avoid shadowing devname() on BSD systems

Daniel P. Berrange berrange at redhat.com
Mon Dec 6 11:06:59 UTC 2010


On Fri, Dec 03, 2010 at 11:31:18AM -0700, Eric Blake wrote:
> On 12/03/2010 10:08 AM, Justin Clift wrote:
> > Thanks Eric.  Captured the complete make log this time, to ensure it's fixed.
> > 
> > The same warning also appears in a few other places. :/
> > 
> >   libvirt.c: In function 'virDomainOpenConsole':
> >   libvirt.c:13169: warning: declaration of 'devname' shadows a global declaration [-Wshadow]
> >   /usr/include/stdlib.h:290: warning: shadowed declaration is here [-Wshadow]
> 
> Yuck.  'devname' is just too handy to be penalized by BSD's namespace
> pollution.  What if we instead do this in internal.h:
> 
> #include <stdlib.h>
> /* Silence -Wshadow on BSD systems, which declare a devname() that we
>  * don't care about */
> #define devname vir_devname
> 
> then all other shadowing warnings should just go away, without us having
> to worry about the problem cropping up again.

I dunno, I'd just change our variable to dname, or devicename.

Regards,
Daniel




More information about the libvir-list mailing list