This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH libcpp] Use CPP() for Wbuiltin-macro-redefined


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]