diff options
author | Simon Baldwin <simonb@google.com> | 2008-09-18 15:39:08 +0000 |
---|---|---|
committer | Simon Baldwin <simonb@gcc.gnu.org> | 2008-09-18 15:39:08 +0000 |
commit | c047ce93830ab288948c3e225fc8c5efdfbe3c2a (patch) | |
tree | e6725c527874d936bd2e164a6a7f885ebaffaf47 /gcc/c.opt | |
parent | 1d295886287812ee7e5b5bfc63ff598a2a9e9958 (diff) | |
download | gcc-c047ce93830ab288948c3e225fc8c5efdfbe3c2a.tar.gz |
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
Diffstat (limited to 'gcc/c.opt')
-rw-r--r-- | gcc/c.opt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/c.opt b/gcc/c.opt index d33fa46e8a7..94d6047a5a3 100644 --- a/gcc/c.opt +++ b/gcc/c.opt @@ -131,6 +131,10 @@ Wbad-function-cast C ObjC Var(warn_bad_function_cast) Warning Warn about casting functions to incompatible types +Wbuiltin-macro-redefined +C ObjC C++ ObjC++ Warning +Warn when a built-in preprocessor macro is undefined or redefined + Wc++-compat C ObjC Var(warn_cxx_compat) Warning Warn about C constructs that are not in the common subset of C and C++ |