开发者

Parasoft rulewizard

I'm trying to create a static rule to check the token passing for defensive programming in a SIL4 application.

The rule is the following: "Each functions shall have a const uint_32 as last parameter"

ie:

uint_32 foo(uint_32 a, uint_32 b, const uint_32 c)   ok 
uint_32 foo(uint_32 a, uint_32 b, const uint_16 c)  NOK
uint_32 foo(uint_32 a, uint_32 b, uint_32 c)  NOK
uint_32 foo(uint_32 a, const uint_32 b, uint_32 c)  NOK 

There's someone that may help me? I'm groping in the d开发者_Python百科ark


You can first collect numbers of all parameters (using ParamNumber property) in a collector. Then select parameter with ParamNumber equal to the highest collected number (you can use MAX() to get that). Then you can check if this parameter has appropriate type.

Irek

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜