主要内容

AUTOSAR C++14 Rule M5-0-6

An implicit integral or floating-point conversion shall not reduce the size of the underlying type

描述

规则定义

An implicit integral or floating-point conversion shall not reduce the size of the underlying type.

理由

将基础类型转换为较小类型可能会导致信息丢失。

Polyspace 实现

如果是转换为具有不同符号的更窄整数类型,那么规则 M5-0-4 优先于规则 M5-0-6。只会显示规则 M5-0-4。

故障排除

如果您预期会出现违规,而 Polyspace® 未报告该违规,请参阅诊断为何编码规范违规未按预期显示

检查信息

组:表达式
类别:必需、自动

版本历史记录

在 R2019a 中推出