[PATCH] Warn when comparing nonnull arguments to NULL in a function.
Jakub Jelinek
jakub@redhat.com
Wed Sep 9 22:33:00 GMT 2015
On Wed, Sep 09, 2015 at 04:01:07PM -0600, Jeff Law wrote:
> > * gcc.dg/nonnull-4.c: New test.
> > * g++.dg/warn/nonnull3.C: Likewise.
If the tests are the same, perhaps stick just one test into
c-c++-common/nonnull-1.c instead? Also, all the "cp1 compared to NULL"
strings mention cp1, did you mean the second one to mention cp2 and so on?
> Can you also upate the -Wnonnull documentation in invoke.texi to indicate it
> also will warn if it discovers a non-null argument that is compared against
> null?
>
> With the doc fix and a bootstrap/regression test, this patch ought to be
> fine.
Jakub
More information about the Gcc-patches
mailing list