CWARN.IMPLICITINT

Anachronistic implicit int

The CWARN.IMPLICITINT checker finds instances of the anachronistic 'implicit int' rule, in which int is assumed when no type is specified for an entity. This rule is applicable to C only.

Vulnerable code example

Copy
  #include <stdio.h>
       foo(char c) 
       {
         char x = c + 1;
         printf("Foo says: %c\n", c);
         return 1;
       }

Klocwork flags line 2 to indicate an implicit int.

Related checkers