Find a missing element in a sorted list
Why does removing the else{} case cause the compiler to give a warning for it?


The compiler will indeed issue a warning if a value-returning function doesn't return a value for every path.  Ignoring this warning could then cause undefined behavior.

If you intend for bSearch() to return -1 on failure, then you can put just one return -1; at the very end of the function and remove the elses that return -1.