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

1  void main()   
2  {
3    return;
4  }

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