Giving the following example:
- (BOOL) doSomething: (NSError**) pError
{
*pError = [NSError ....];
}
Analyzer will return the following error:
Potential null dereference. According to coding standards in 'Creating and Returning NSError Objects' the parameter may be null.
To which the suggestion would be to change this to:
- (BOOL) doSomething: (NSError**) pError
{
if(pError)
{
*pError = [NSError ....];
}
}
But I would prefer to add a nonnull attribute to the error parameter to discourage the use of passing a null. I cannot figure out how to get the arguments to this correct. Is it possible for a double pointer to have a nonnull attribute?