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
编辑: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 个评论
galaxy
galaxy 2020-9-4
编辑:galaxy 2020-9-4
@MathWorks Support Team
What about enum type check in jmaab.jc_0802?
I defined enum Pos_Enum as:
In stateflow chart, I set DrvPos = Pos_Enum.HIGH; with DrvPos data type is also Pos_Enum.
So why still warning in jmaab.jc_0802?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Stateflow 的更多信息

标签

尚未输入任何标签。

产品


版本

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by