VHDL1068: Functions should always return a value

Summary

Count: 1

ReliabilitySecurityMaintainabilityCode attributeEffort to fixTags
HIGH--Intentionality | Logical20minsynthesis, bug-finder, do254, do254-cp9, linty-ultra

Description

A function that does not always return a value is likely a coding mistake. All paths of a function should return a value.

Noncompliant code example

function my_function (i : in integer) return std_logic is
begin
  if i > 5 then
    return '0';
  end if;
end;

Compliant solution

function my_function (i : in integer) return std_logic is
begin
  if i > 5 then
    return '0';
  else
    return '1';
  end if;
end;

Parameters

No parameters.