Why is hisf_0015: Check Stateflow charts for strong data typing failing when a function in the expression is defined in custom code?
6 次查看(过去 30 天)
显示 更早的评论
I have a MIN function defined as a macro in a C header that is being used in a Stateflow chart.
/* header */
#define MIN(A,B) ((A) > (B) ? (B) : (A))
%%Stateflow
[MIN(a,b) - single(2) == single(4)]
where a and b are singles. This expression is being flagged by hisf_0015, even though everything is a single.
Why is the check flagging this expression?
采纳的回答
MathWorks Support Team
2020-8-10
编辑:MathWorks Support Team
2020-8-10
This is a limitation of hisf_0015 because the 'MIN' macro is defined in a custom source file. The recommended workaround is to explicitly cast 'MIN' to a single data type.
The same limitation seems to apply for MAB check mathworks.jmaab.jc_0802.
1 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!