[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Wshadow: Better name for 'optarg'?
From: |
Markus Armbruster |
Subject: |
Re: Wshadow: Better name for 'optarg'? |
Date: |
Thu, 05 Oct 2023 07:17:17 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) |
Philippe Mathieu-Daudé <philmd@linaro.org> writes:
> On 4/10/23 19:35, Thomas Huth wrote:
>> On 04/10/2023 19.23, Richard Henderson wrote:
>>> On 10/4/23 03:05, Philippe Mathieu-Daudé wrote:
>>>> Hi,
>>>>
>>>> I'm getting a bunch of errors for 'optarg' declared in <unistd.h>:
>>>
>>> I thought things like this is why we were trying -Wshadow=local.
>>>
>>> I think it's unlikely that we'll be able to prevent all such cases.
>> Given the broad range of operating systems and libraries that we support in
>> QEMU, I agree with Richard - it will likely be impossible to enable that
>> option without =local by default without risking that compilation breaks on
>> some exotic systems or new versions of various libraries.
>
> -Wshadow=local doesn't seem to work here which is why I switched
> to -Wshadow. I probably misunderstood something from Markus cover
> letter. My setup is:
>
> C compiler for the host machine: clang (clang 14.0.3 "Apple clang version
> 14.0.3 (clang-1403.0.22.14.1)")
>
> I suppose we'll figure that out when eventually enabling -Wshadow=local
> on CI. Meanwhile I already cleaned the 'optarg' warnings that were
> bugging me, see:
> 20231004120019.93101-1-philmd@linaro.org/">https://lore.kernel.org/qemu-devel/20231004120019.93101-1-philmd@linaro.org/
> I'll try to get -Wshadow=local, but the other series still seems a
> good cleanup, as I used more meaningful variable names.
I'm aiming just for -Wshadow=local now. If somebody else gets us all
the way to -Wshadow, I'll clap from the sidelines.
I'm mildly skeptical about -Wshadow without =local when targeting a wide
range of toolchains over a long time.
Not an objection to cleanup patches such as yours!
- Wshadow: Better name for 'optarg'?, Philippe Mathieu-Daudé, 2023/10/04
- Re: Wshadow: Better name for 'optarg'?, Daniel P . Berrangé, 2023/10/04
- Re: Wshadow: Better name for 'optarg'?, Richard Henderson, 2023/10/04
- Re: Wshadow: Better name for 'optarg'?, Thomas Huth, 2023/10/04
- Re: Wshadow: Better name for 'optarg'?, Philippe Mathieu-Daudé, 2023/10/04
- Re: Wshadow: Better name for 'optarg'?, Warner Losh, 2023/10/04
- Re: Wshadow: Better name for 'optarg'?, Thomas Huth, 2023/10/04
- Re: Wshadow: Better name for 'optarg'?, Daniel P . Berrangé, 2023/10/04
- Re: Wshadow: Better name for 'optarg'?, Philippe Mathieu-Daudé, 2023/10/05
- Re: Wshadow: Better name for 'optarg'?,
Markus Armbruster <=
- Re: Wshadow: Better name for 'optarg'?, Philippe Mathieu-Daudé, 2023/10/05
- Re: Wshadow: Better name for 'optarg'?, Daniel P . Berrangé, 2023/10/05
Re: Wshadow: Better name for 'optarg'?, Claudio Fontana, 2023/10/05