On Wed, Oct 4, 2023, 4:16 AM Daniel P. Berrangé <berra...@redhat.com> wrote:

> On Wed, Oct 04, 2023 at 12:05:04PM +0200, Philippe Mathieu-Daudé wrote:
> > Hi,
> >
> > I'm getting a bunch of errors for 'optarg' declared in <unistd.h>:
> >
> > NAME
> >      getopt – get option character from command line argument list
> >
> > LIBRARY
> >      Standard C Library (libc, -lc)
> >
> > SYNOPSIS
> >      #include <unistd.h>
> >
> >      extern char *optarg;
> >
> >
> > qom/object_interfaces.c:262:53: error: declaration shadows a variable in
> the
> > global scope [-Werror,-Wshadow]
> > ObjectOptions *user_creatable_parse_str(const char *optarg, Error **errp)
>
> snip
>
> > Do we want to clean those? Any good name suggestion?
>
> Yes.  any of "argval", "opts", "optstr", "optval".
>

For the parsing in bsd-user I just removed the variable entirely and
removed the updating of its value since the parsing code was trying to do
what getopt also did...

Warner

With regards,
> Daniel
> --
> |: https://berrange.com      -o-
> https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org         -o-
> https://fstop138.berrange.com :|
> |: https://entangle-photo.org    -o-
> https://www.instagram.com/dberrange :|
>
>
>

Reply via email to