[PATCH resend 1/2] PR c/65403 - Ignore -Wno-error=<some-future-warning>
Martin Liška
mliska@suse.cz
Mon Aug 26 12:49:00 GMT 2019
On 8/23/19 6:52 PM, Alex Henrie wrote:
> On Fri, Aug 23, 2019 at 3:13 AM Martin Liška <mliska@suse.cz> wrote:
>> On 8/23/19 6:17 AM, Alex Henrie wrote:
>>> +vec<const char *> ignored_wnoerror_options;
>>
>> Here you'll need to add a comment.
>
> The declaration of ignored_options in opts-global.c doesn't have a
> comment either. What would you like the comment to say?
I would just write a comment for
ignored_wnoerror_options
>
>>> + const char * opt = ignored_wnoerror_options.pop ();
>>
>> No space between '*' and 'opt' please.
>
> Okay.
>
>> You don't want to append and option that is already in the ignored_wnoerror_options:
>>
>> $
>> ./xgcc -B. -Wunused-variable -Werror -Wno-error=some-future-warning -Wno-error=some-future-warning /tmp/main2.c
>> /tmp/main2.c: In function âmainâ:
>> /tmp/main2.c:3:7: error: unused variable âfooâ [-Werror=unused-variable]
>> 3 | int foo; /* { dg-error "unused variable 'foo'" } */
>> | ^~~
>> /tmp/main2.c: At top level:
>> cc1: error: â-Wno-error=some-future-warningâ: no option â-Wsome-future-warningâ [-Werror]
>> cc1: error: â-Wno-error=some-future-warningâ: no option â-Wsome-future-warningâ [-Werror]
>> cc1: all warnings being treated as errors
>>
>> As seen the error is there twice.
>
> Joseph explicitly asked me to make -Wno-error=some-future-warning
> behave the same as -Wno-some-future-warning (see
> <https://gcc.gnu.org/ml/gcc-patches/2019-03/msg00065.html>), and
> -Wno-some-future-warning prints multiple warnings if the option is
> given multiple times.
>
>> One question about the behavior:
>>
>> Why do I need to have another warning to get the warning: â-Wno-error=some-future-warningâ printed?
>
> If we always give a warning about -Wno-error=some-future-warning then
> combining that option with -Werror would cause compilation to fail,
> which we don't want.
Ah, I see. It's not easy to implement that in a reasonable way. Now I understand that.
Thanks,
Martin
>
> -Alex
>
More information about the Gcc-patches
mailing list