While looking at PR c/16351, I noticed that all tests proposed for -Wnull-attribute (https://gcc.gnu.org/ml/gcc-patches/2014-01/msg01715.html) could be warned from the FEs by simply extending the existing Wnonnull. Bootstrapped and regression tested on x86_64-linux-gnu. OK? gcc/ChangeLog: 2015-07-22 Manuel López-Ibáñez PR c/16351 * doc/invoke.texi (Wnonnull): Document behavior for returns_nonnull. gcc/testsuite/ChangeLog: 2015-07-22 Manuel López-Ibáñez PR c/16351 * c-c++-common/wnonnull-1.c: New test. gcc/cp/ChangeLog: 2015-07-22 Manuel López-Ibáñez PR c/16351 * typeck.c (check_return_expr): Call maybe_warn_returns_nonnull. gcc/c-family/ChangeLog: 2015-07-22 Manuel López-Ibáñez PR c/16351 * c-common.c (maybe_warn_returns_nonnull): New. * c-common.h (maybe_warn_returns_nonnull): Declare. gcc/c/ChangeLog: 2015-07-22 Manuel López-Ibáñez PR c/16351 * c-typeck.c (c_finish_return): Call maybe_warn_returns_nonnull.