Warn if another typedef'd name of a type is used in an argument list

后端 未结 6 1499
天涯浪人
天涯浪人 2021-01-02 09:46

Consider a large project, where many types are typedef\'d, e.g.

typedef int age;
typedef int height;

and some functions gettin

6条回答
  •  礼貌的吻别
    2021-01-02 10:34

    Klocwork has some checks related to what they call "strong typing".

    For your code it throws STRONG.TYPE.ASSIGN.ARG because argument types do not match.

    It also complains about assigning int values (the consts) to age and height typed variables and about using the variables as int in printf.

    I heard it is quite expensive, though.

提交回复
热议问题