aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-opts.c
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2005-05-02 04:22:45 +0000
committerMichael Matz <matz@suse.de>2005-05-02 04:22:45 +0000
commit6ce3ab9fdeab791f0082c362fb1133b2380dc5ed (patch)
tree81e0ec0700839598638506aadcfb471636db87e6 /gcc/c-opts.c
parent0af5fd38ca12457f6e7b361492814796c91d8df5 (diff)
PR c++/19542
* c-common.c (c_common_nodes_and_builtins): Create global null_node. (warn_strict_null_sentinel): Define. (check_function_sentinel): Check for null_node as valid sentinel too. * c-common.h (c_tree_index): Added CTI_NULL. (null_node) Define global_tree[CTI_NULL]. (warn_strict_null_sentinel): Declare. * c-opts.c: (c_common_handle_option): Handle -Wstrict-null-sentinel. * c.opt: (Wstrict-null-sentinel): New C++ option. * doc/invoke.texi (C++ Options): Document -Wstrict-null-sentinel. * cp-tree.h (cp_tree_index): Remove CPTI_NULL, to be defined in C common frontend. (null_node): Remove. * lex.c (cxx_init): Move null_node initialisation to C common frontend. * g++.dg/warn/sentinel.C: New testcase for __null sentinels added. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@99091 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-opts.c')
-rw-r--r--gcc/c-opts.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/c-opts.c b/gcc/c-opts.c
index 4ac8e9d4395..ebf23e571d7 100644
--- a/gcc/c-opts.c
+++ b/gcc/c-opts.c
@@ -477,6 +477,10 @@ c_common_handle_option (size_t scode, const char *arg, int value)
warn_return_type = value;
break;
+ case OPT_Wstrict_null_sentinel:
+ warn_strict_null_sentinel = value;
+ break;
+
case OPT_Wsystem_headers:
cpp_opts->warn_system_headers = value;
break;