This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH libcpp] Use CPP() for Wbuiltin-macro-redefined
- 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: Wed, 27 Aug 2014 17:10:39 +0000
- Subject: Re: [PATCH libcpp] Use CPP() for Wbuiltin-macro-redefined
- Authentication-results: sourceware.org; auth=none
- References: <CAESRpQDMehzs99iOZgeysLQ6s+OTd_1EhBbKPFH=8V4fJgdqDA at mail dot gmail dot com>
On Sat, 23 Aug 2014, Manuel López-Ibáñez wrote:
> The problem with overriding the default in libcpp is fixed by setting
> Init(1) in c.opt to match the default. However, it is too easy to
> forget the Init(). It would be better if no Init() meant "use the
> default of libcpp". This would require calling another generated
> function just after initializing cpp_opts to set the defaults in
> global_opts. Would that be ok? Or should I just set Init() explicitly
> for every CPP()?
I think I prefer having the defaults explicit in the .opt file (generally,
prefer having information about option settings and how options relate to
each other as data in the .opt files over having it in code). So that
means setting Init() explicitly for such options.
> libcpp/ChangeLog:
>
> 2014-08-23 Manuel López-Ibáñez <manu@gcc.gnu.org>
>
> * macro.c (warn_of_redefinition): Suppress warnings for builtins
> that lack the NODE_WARN flag, unless Wbuiltin-macro-redefined.
> (_cpp_create_definition): Use Wbuiltin-macro-redefined for
> builtins that lack the NODE_WARN flag.
> * directives.c (do_undef): Likewise.
> * init.c (cpp_init_special_builtins): Do not change flags
> depending on Wbuiltin-macro-redefined.
>
>
> gcc/c-family/ChangeLog:
>
> 2014-08-23 Manuel López-Ibáñez <manu@gcc.gnu.org>
>
> * c.opt (Wbuiltin-macro-redefined): Use CPP, Var and Init.
> * c-opts.c (c_common_handle_option): Do not handle here.
OK.
--
Joseph S. Myers
joseph@codesourcery.com