https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16351
--- Comment #49 from Jon Grant <jg at jguk dot org> --- (In reply to Martin Sebor from comment #48) > Send a check to Manuel ;) The feature is available under the > -Wnull-dereference option (see comment 31). Unfortunately, due to false > positives, the option was removed from -Wall in a subsequent commit > (r226751) and has to be enabled explicitly. > > The similar -Wnonnull option that was just recently enhanced to detect > related problems is in -Wall, and it seems to me that it would make sense to > treat both of these options the same: i.e., enable both with -Wall. To do > that, the former option might need to be tweaked to reduce its false > positive rate. At the same time, the -Wnonnull option still has a high rate > of false negatives and so it could stand to be enhanced to do a better job. > The challenge is striking the right balance between the two rates that is > acceptable to everyone. Thank you for your reply. -Werror=null-dereference doesn't seem to be in my compiler: gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609 Is it just in GCC6 branch? -Wnonnull is present though. Re the feature, I think it can't be that hard to check per function can it...?