Return expression expected

In a function that has a return type, there must be a return statement to return a value to the caller of the function. Each code path in the function must eventually lead to a return statement, otherwise this error occurs.

int func test()
endfunc     ; Error: no return statement

int func test2()
  return 3  ; OK
endfunc  

See Also
Errors