# VHDL170: Functions should only contain one single "return" statement ## Summary ```{raw} html
| Reliability | Security | Maintainability | Code attribute | Effort to fix | Tags |
|---|---|---|---|---|---|
| - | - | LOW | Intentionality | Clear | 2min | synthesis, vscode, linter, simulation |
Functions should only contain one single return statement.
function my_function(z : boolean) return std_logic is
begin
if z then
return '1';
else
return '0';
end if;
end;
function my_function(z : boolean) return std_logic is
variable tmp : std_logic;
begin
if z then
tmp := '1';
else
tmp := '0';
end if;
return tmp; -- Compliant
end;
```
## Parameters
No parameters.
```{raw} html
```