[cfe-dev] Clang analyzer annotations

Jean-Daniel Dupas devlists at shadowlab.org
Thu Jun 25 07:29:14 PDT 2009


Hello,

I just wonder why there is an attribute to tell that a functions  
returns a retained value, but no way to tell that it will release an  
argument.

It may be useful for example if you want to write a safe CFRelease  
function:

static __inline__
void SafeCFRelease(CFTypeRef cfobject) {
	if (cfobject) CFRelease(cfobject);
}

I know this attribute was available no so long ago, but I don't see it  
anymore. What was wrong with it ?

Thanks
Jean-Daniel



More information about the cfe-dev mailing list