This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: attribute nonnull/expect_nonnull for return value?
- From: Ian Lance Taylor <iant at google dot com>
- To: Daniel Frey <d dot frey at gmx dot de>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Sun, 25 Mar 2012 20:17:21 -0700
- Subject: Re: attribute nonnull/expect_nonnull for return value?
- References: <DDEC3936-7085-461C-AC35-B8945B3239C8@gmx.de>
Daniel Frey <d.frey@gmx.de> writes:
> GCC now knows that the arguments are nonnull, but how to I tell the
> compiler that the returned pointer is nonnull? Or if null is allowed
> but only the exception to the rule, I would like to tell the compiler
> that is should *expect* the pointer to be nonnull, but not disallow
> null. Actually, the second case is more important to me, but I think
> both should be possible.
At present, as far as I know, there is no way to do either.
Ian