This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] PR 51712 -Wtype-limits should not trigger for enum constants
- From: Manuel López-Ibáñez <lopezibanez at gmail dot com>
- To: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Cc: Jason Merrill <jason at redhat dot com>, "Joseph S. Myers" <joseph at codesourcery dot com>
- Date: Mon, 14 May 2012 18:23:07 +0200
- Subject: Re: [RFC] PR 51712 -Wtype-limits should not trigger for enum constants
- References: <CAESRpQA6npHRUvy=S-rpmw8+KP-9SfdabzPGpkYdVAsBpdpi4Q@mail.gmail.com>
PING: http://gcc.gnu.org/ml/gcc-patches/2012-05/msg00383.html
And on a general note, what is the opinion of the C/C++ maintainers
about tracking the original source code more faithfully than currently
done?
Cheers,
Manuel.
On 5 May 2012 11:06, Manuel López-Ibáñez <lopezibanez@gmail.com> wrote:
> This patch adds the ability to see in shorten_compare that a constant
> comes from an enumeral type. It does so by using in both C/C++ the
> existing infrastructure from the C FE (c_expr). Currently, only the C
> FE carries down the correct information to avoid warning, so C++ still
> warns. However, this patch also opens the possibility to pass down
> this info in the C++ FE using c_expr, and avoid warning in a follow up
> patch.
>
> Bootstrapped and regression tested. This is a proof-of-concept, so I
> don't provide a changelog or update the comments of new/existing
> functions.
>
> Comments? Is this approach OK?
>
> Cheers,
>
> Manuel.