qemu-devel
[Top][All Lists]
Advanced

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

Re: Wshadow: Better name for 'optarg'?


From: Daniel P . Berrangé
Subject: Re: Wshadow: Better name for 'optarg'?
Date: Wed, 4 Oct 2023 11:15:54 +0100
User-agent: Mutt/2.2.9 (2022-11-12)

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".

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

[Prev in Thread] Current Thread [Next in Thread]