diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-02-16 21:46:17 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-02-16 21:46:17 +0100 |
commit | bf14eba23b25519f20b198110389e1401be8624f (patch) | |
tree | 6293882a904a29a02ec3e42b8a4e35989c6479db /gcc/common.opt | |
parent | 7128d6ab21878794ac2107961338fc8621536a40 (diff) | |
download | gcc-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/common.opt')
-rw-r--r-- | gcc/common.opt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/common.opt b/gcc/common.opt index 520fa9c..3c3669a 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -616,6 +616,10 @@ Wlarger-than= Common RejectNegative Joined UInteger Warning -Wlarger-than=<number> Warn if an object is larger than <number> bytes. +Wnonnull-compare +Var(warn_nonnull_compare) Warning +Warn if comparing pointer parameter with nonnull attribute with NULL. + Wnull-dereference Common Var(warn_null_dereference) Warning Warn if dereferencing a NULL pointer may lead to erroneous or undefined behavior. |