[Bug c/20318] RFE: add attribute to specify that a function never returns NULL

dnovillo at redhat dot com gcc-bugzilla@gcc.gnu.org
Fri Mar 4 17:59:00 GMT 2005


------- Additional Comments From dnovillo at redhat dot com  2005-03-04 17:59 -------
Subject: Re:  RFE: add attribute to specify that a function never
 returns NULL

giovannibajo at libero dot it wrote:
> ------- Additional Comments From giovannibajo at libero dot it  2005-03-04 17:53 -------
> I don't object that this feature is indeed needed, but I would still like to 
> see a reduced testcase from Subversion which shows a bogus warning that could 
> be fixed with this attribute.
> 
I have attached the pre-processed test case from Joe.

> BTW, Diego, once ASSERT_EXPR becomes a generic node, can't just the C++ FE uses 
> it to assert that the return value for a CALL_EXPR to an allocation function is 
> non-zero?
> 
The attribute would be enough.  The FE need only set an ECF_ flag to the 
CALL_EXPR and the optimizers will pick it up from there.


Diego.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20318



More information about the Gcc-bugs mailing list