]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/c-family/c.opt
re PR c++/19542 (attribute(sentinel) has problems with C++ __null)
authorMichael Matz <matz@suse.de>
Mon, 2 May 2005 04:22:45 +0000 (04:22 +0000)
committerMichael Matz <matz@gcc.gnu.org>
Mon, 2 May 2005 04:22:45 +0000 (04:22 +0000)
commitb2f97e4a12858733fc4977859febecd144acb8dd
tree81e0ec0700839598638506aadcfb471636db87e6
parentf8f9fb4526bea97382af2024b7b268725d544239
re PR c++/19542 (attribute(sentinel) has problems with C++ __null)

        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.

From-SVN: r99091
gcc/ChangeLog
gcc/c-common.c
gcc/c-common.h
gcc/c-opts.c
gcc/c.opt
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/lex.c
gcc/doc/invoke.texi
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/warn/sentinel.C [new file with mode: 0644]