aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-02-16 21:46:17 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2016-02-16 21:46:17 +0100
commitbf14eba23b25519f20b198110389e1401be8624f (patch)
tree6293882a904a29a02ec3e42b8a4e35989c6479db /gcc/doc
parent7128d6ab21878794ac2107961338fc8621536a40 (diff)
downloadgcc-bf14eba23b25519f20b198110389e1401be8624f.zip
gcc-bf14eba23b25519f20b198110389e1401be8624f.tar.gz
gcc-bf14eba23b25519f20b198110389e1401be8624f.tar.bz2
re PR c/69835 (-Wnonnull diagnoses parameter comparisons with NULL even when those could have changed)
PR c/69835 * common.opt (Wnonnull-compare): New warning. * doc/invoke.texi (-Wnonnull): Remove text about comparison of arguments against NULL. (-Wnonnull-compare): Document. * Makefile.in (OBJS): Add gimple-ssa-nonnull-compare.o. * tree-pass.h (make_pass_warn_nonnull_compare): Declare. * passes.def (pass_warn_nonnull_compare): Add. * gimple-ssa-nonnull-compare.c: New file. c-family/ * c.opt (Wnonnull-compare): Enable for -Wall. c/ * c-typeck.c (build_binary_op): Revert 2015-09-09 change. cp/ * typeck.c (cp_build_binary_op): Revert 2015-09-09 change. testsuite/ * c-c++-common/nonnull-1.c: Use -Wnonnull-compare instead of -Wnonnull in dg-options. * c-c++-common/nonnull-2.c: New test. From-SVN: r233472
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/invoke.texi16
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 85f2221..2bd793d 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -276,7 +276,8 @@ Objective-C and Objective-C++ Dialects}.
-Wmain -Wmaybe-uninitialized -Wmemset-transposed-args @gol
-Wmisleading-indentation -Wmissing-braces @gol
-Wmissing-field-initializers -Wmissing-include-dirs @gol
--Wno-multichar -Wnonnull -Wnormalized=@r{[}none@r{|}id@r{|}nfc@r{|}nfkc@r{]} @gol
+-Wno-multichar -Wnonnull -Wnonnull-compare @gol
+-Wnormalized=@r{[}none@r{|}id@r{|}nfc@r{|}nfkc@r{]} @gol
-Wnull-dereference -Wodr -Wno-overflow -Wopenmp-simd @gol
-Woverride-init-side-effects -Woverlength-strings @gol
-Wpacked -Wpacked-bitfield-compat -Wpadded @gol
@@ -3537,6 +3538,7 @@ Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
-Wmissing-braces @r{(only for C/ObjC)} @gol
-Wnarrowing @r{(only for C++)} @gol
-Wnonnull @gol
+-Wnonnull-compare @gol
-Wopenmp-simd @gol
-Wparentheses @gol
-Wpointer-sign @gol
@@ -3795,12 +3797,18 @@ formats that may yield only a two-digit year.
Warn about passing a null pointer for arguments marked as
requiring a non-null value by the @code{nonnull} function attribute.
-Also warns when comparing an argument marked with the @code{nonnull}
-function attribute against null inside the function.
-
@option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}. It
can be disabled with the @option{-Wno-nonnull} option.
+@item -Wnonnull-compare
+@opindex Wnonnull-compare
+@opindex Wno-nonnull-compare
+Warn when comparing an argument marked with the @code{nonnull}
+function attribute against null inside the function.
+
+@option{-Wnonnull-compare} is included in @option{-Wall}. It
+can be disabled with the @option{-Wno-nonnull-compare} option.
+
@item -Wnull-dereference
@opindex Wnull-dereference
@opindex Wno-null-dereference