Introduction: I got a function doing some work and returning a bool. The bool should be false, if some error occured. So I could use the bool, if I want to check for errors. But what, if I am completely sure (I know, you can never be completely sure, but maybe you understand what I mean) that there will be no error in this part or you just don't care if there is because it has no influence.
Question: Will there occure some memory leak or other performance issue if I just not 'catch' the returned bool?
minimum Codeexampe:
bool my_func(/*some variables*/)
{
if(/*error-condition*/)
{
//do something
return false;
}
else if(/*other error-condition*/)
{
//do something
return false;
}
return true;
}
int main(void)
{
my_func(/*variables*/);
return 0;
}
Comment: that will not return any compiling or runtime errors or unhandled exceptions