By moving the warning earlier, we'll still warn for the most cases, but
won't warn in the more convoluted cases.  We can perhaps work on it
further
in GCC 8.  If we keep it as is, I think most users will just -Wno-nonnull
as soon as they run into some warning that will be hard to figure out
what
is going on.  At that point they will not get warnings even for the
obvious
cases that we used to warn.  Look at how the Linux kernel folks
disable most
of warnings even for smaller reasons.
But again, the user case is no different than other warnings that are
sensitive to optimizations.

My sense is that we should revert and table until gcc-8 where we can
evaluate the space more thoroughly.

I think that would be unfortunate.  We have a number of alternatives
that seem much preferable.

I have a trivial patch that avoids the sanitizer warnings by disabling
the late -Wnonnull warning when -fsanitize=undefined is specified.
A simple fix for the GCC warnings discovered by profiledbootstrap-O3
and verified on powerpc64 and x86_63 was posted for review last week.

Jakub's patch avoids those warnings and obviates any GCC changes (IIUC).

There is also the option of introducing -Wnonnull=2 that warns late
and not including it in -Wall or -Wextra.  All three of this have
been tested.

All of these seem safe to me and give interested users the ability to
experiment with the warning and give us feedback.  With alternative
(1) users have the option of turning -Wnonnull off.  Since the early
warning detects just a trivial subset of these problems (and is still
prone to false positives) they would be giving up little by doing that.

Martin

Reply via email to