CWARN.RET.MAIN

Incorrect return type for main

The CWARN.RET.MAIN checker finds instances in which the return type for 'main' is not 'int'.

Vulnerability and risk

This error is typically a typo that causes design intent to fail.

Vulnerable code example

Copy
  void main()   
  {
    return;
  }

Klocwork flags line 1 with its incorrect 'main' signature.