cpplib.h (struct cpp_options): Add new boolean flag warn_builtin_macro_redefined.
* include/cpplib.h (struct cpp_options): Add new boolean flag warn_builtin_macro_redefined. * init.c (cpp_create_reader): Initialize warn_builtin_macro_redefined. * (struct builtin_operator): Split out from previous struct builtin, enhance extra const correctness. * (struct builtin_macro): Split out from previous struct builtin, add new always_warn_if_redefined flag, enhance const correctness. * (mark_named_operators): Use struct builtin_operator. * (cpp_init_special_builtins): Use struct builtin_macro, add NODE_WARN to builtins selectively. * macro.c (warn_of_redefinition): Return false if a builtin macro is not flagged with NODE_WARN. * c-opts.c (c_common_handle_option): Add handling for -Wbuiltin-macro-redefined command line option. * c.opt: Added builtin-macro-redefined option. * doc/invoke.texi (Warning Options): Add -Wbuiltin-macro-redefined documentation. * gcc.dg/builtin-redefine.c: New. From-SVN: r140461
This commit is contained in:
parent
1d29588628
commit
c047ce9383
10 changed files with 169 additions and 25 deletions
|
@ -349,6 +349,10 @@ struct cpp_options
|
|||
Presumably the usage is protected by the appropriate #ifdef. */
|
||||
unsigned char warn_variadic_macros;
|
||||
|
||||
/* Nonzero means warn about builtin macros that are redefined or
|
||||
explicitly undefined. */
|
||||
unsigned char warn_builtin_macro_redefined;
|
||||
|
||||
/* Nonzero means turn warnings into errors. */
|
||||
unsigned char warnings_are_errors;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue