Void function returns value

The VOIDRET checker finds functions declared as void that return a value.

Vulnerability and risk

This issue is typically style-related, but may indicate a logic problem in the code.

Vulnerable code example

  class A{
     void foo();
  void A::foo()
    return 0;

Klocwork flags line 6, in which a value is returned from void function foo().

Security training

Application security training materials provided by Secure Code Warrior.