How are integer types converted implicitly?

前端 未结 3 1739
自闭症患者
自闭症患者 2020-12-19 12:21

The following code fails on a MISRA check. The concrete error message is:

(MISRA-C:2004 10.1/R) The value of an expression of integer type shall not

3条回答
  •  隐瞒了意图╮
    2020-12-19 12:31

    I would suspect the compiler internally handles enums as unsigned integer, as long there is no negative value within the enum.

提交回复
热议问题