auto generate cpp_reason to gcc OPT_W table

Joseph S. Myers
Tue Sep 9 20:18:00 GMT 2014

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?


Joseph S. Myers

More information about the Gcc-patches mailing list