This is the mail archive of the
mailing list for the GCC project.
Re: PING [PATCH] treat -Wxxx-larger-than=HWI_MAX special (PR 86631)
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Martin Sebor <msebor at gmail dot com>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, Jakub Jelinek <jakub at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 2 Aug 2018 16:34:25 +0000
- Subject: Re: PING [PATCH] treat -Wxxx-larger-than=HWI_MAX special (PR 86631)
- References: <firstname.lastname@example.org> <CAFiYyc1EHG0YGKVvOPc8QyUWy2dc0+f_5ubcqxZsJLX2GsSz-A@mail.gmail.com> <email@example.com> <20180725145724.GR17988@tucnak> <firstname.lastname@example.org> <CAFiYyc1z6GF8LZ4BpmBJ_wCpeDSiS=kEYoNS0QoqSPBtLzaPxg@mail.gmail.com> <email@example.com> <firstname.lastname@example.org> <email@example.com>
On Wed, 1 Aug 2018, Martin Sebor wrote:
> Richard, do you have any further comments or suggestions or is
> the patch acceptable?
> I realize it's not ideal but I don't see how to achieve the ideal
> (understanding PTRDIFF_MAX) without deferring the processing of
> these options until the back end has been initialized. It would
> still mean setting aside some special value, traversing options
> again, looking for the Host_Wide_Int ones with the special value,
> and replacing it with the value of PTRDIFF_MAX. That doesn't seem
> any cleaner than the current solution, just a lot more work (not
> just to implement but for the compiler to go through at startup).
> Joseph, can you think of anything better?
I think the cleanest option for accepting symbolic values would require
options accepting such a value in addition to numeric arguments to have
additional data allocated (effectively storing both a numeric argument and
an Enum argument), and then the late initialization as noted to set the
numeric value based on the Enum argument if one was given. As noted,
that's significant extra complexity.
Joseph S. Myers