A function that does not always return a value is likely a coding mistake. All paths of a function should return a value.
function my_function (i : in integer) return std_logic is
begin
if i > 5 then
return '0';
end if;
end;
function my_function (i : in integer) return std_logic is
begin
if i > 5 then
return '0';
else
return '1';
end if;
end;