------- Comment #4 from steven at gcc dot gnu dot org 2006-05-01 19:17 ------- Re. comment #2 and comment #3, yes you are expecting too much of the nonnull attribute. The attribute only applies to function arguments, not to function results.
-- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27336