The error means that if side is neither left nor right, your function will not return a value - either side is declared improperly or your enum is. An enum should be defined like
enum orientation {left, right};
So try changing your orientation structure to that.