RETVOID.IMPLICIT

Implicitly int function returns void value

The RETVOID.IMPLICIT checker finds instances in which an implicitly int function has an explicit return statement with no value.

Vulnerability and risk

If the returned value is used, it can cause the use of uninitialized memory.

Vulnerable code example

Copy
  #include  <math.h>
  #include  <stdio.h>
  #define     OK    1
  func ()
  {
    return; 
  }

Klocwork flags line 6 in this code, in which the implicitly int function func() has a return statement with no value.

Related checkers

Security training

Application security training materials provided by Secure Code Warrior.