This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: auto generate cpp_reason to gcc OPT_W table
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Manuel López-Ibáñez <lopezibanez at gmail dot com>
- Cc: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 9 Sep 2014 20:18:36 +0000
- Subject: Re: auto generate cpp_reason to gcc OPT_W table
- Authentication-results: sourceware.org; auth=none
- References: <CAESRpQA6=-sLaiqbDFN8uDS4c1wwKgupbjzqw+q=2dqgHXGq8A at mail dot gmail dot com>
On Fri, 5 Sep 2014, Manuel López-Ibáñez wrote:
> This adds a new option property CppReason which maps to a warning
> reason code in cpplib.h. This allows us to auto-generate
> cpp_reason_option_codes[], which maps from CPP warning codes to GCC
> ones, thus making a bit harder to forget to update this table (which
> evidently has happened a lot in the past).
>
> Unfortunately, to use cpp warning codes we need to include cpplib.h in
> options.h and this would conflict with other parts of the compiler,
> thus I protect the table with #ifdef GCC_C_COMMON_H, and make sure in
> c-common.c that cpplib.h is not included before c-common.h.
>
> This patch applies on top of the previous patch about Wnormalized= but
> it is mostly independent of it.
>
> Bootstrapped and regression tested on x86_64-linux-gnu
>
> OK?
OK.
--
Joseph S. Myers
joseph@codesourcery.com