I’m trying to clean up some issues from xcode’s analyzer. One I haven’t found a solution to is the “Branch condition evaluates to a garbage value”. It’s occurring in the following way:
int methodToCloseMyDatabase(sqlite3 **myDatabase, const char *callingFunctionName)
{
if (myDatabase)
{
if (*myDatabase) // The warning is thrown here
{
// Do something
}
}
}
This error sounds to me as if CLang has analyzed your code and found that *myDatabase is not set to anything.
It could even be that the analyzer has found a possible code branch that does not set the value.