If the oper is not one of * / + -, calc will not return. So not all paths return a value in your calc function.
One option is to change the final "else if (...)" into just "else", and sanitize the input beforehand.
Another option is to throw an exception if control reaches past the final else-if. Exceptions would only be if you really don't expect it to happen (exceptions should only be for exceptional cases, and not routine logic).
Or some other type of error-handling (e.g. returning a bool to indicate success, and pass the result via an out parameter reference.).
it was not broken, honestly, so long as the operator was in range.
now, being nefarious, I put in 3,4, and minus, and the answer is -1.
how do you know if that was your default/error result, or legit?
I would check the inputs to ensure the operators are valid. You can leave the return in place to silence the warning, and maybe put an assert if it gets there as that should be unpossible now.