![]() |
![]() |
1880 | ![]() |
||||
![]() | |||||||
| Arithmetic type - Balancing | |||||||
This message is issued when a relational operator is used with operands of different essential type categories. For example:
/*PRQA S 1-9999 ++*/
/*PRQA S 1880, 1802, 1822, 4505 --*/
_Bool boa;
char pca;
enum E {ONE, TWO} ena;
enum F {UNO, DUE} enb;
int sia;
unsigned uia;
float fta;
void f1880 (void)
{
if (boa < pca) ; /* 4505 */
if (boa < ena) ; /* 4505 */
if (boa < sia) ; /* 4505 */
if (boa < uia) ; /* 4505 */
if (boa < fta) ; /* 4505 */
if (pca < ena) ; /* 1880 */
if (pca < sia) ; /* 1880 */
if (pca < uia) ; /* 1880 */
if (pca < fta) ; /* 1880 */
if (ena < enb) ; /* 1880 */
if (ena < sia) ; /* 1880 */
if (ena < uia) ; /* 1880 */
if (ena < fta) ; /* 1802 */
if (sia < uia) ; /* 1822 */
if (sia < fta) ; /* 1802 */
if (uia < fta) ; /* 1802 */
}
MISRA C:2012 Rules applicable to message 1880:
| Rule-10.4 (Required) | Both operands of an operator in which the usual arithmetic conversions are performed shall have the same essential type category |
See also:
![]() | ||
| QA·C Source Code Analyser 8.1
MISRA C:2012 Compliance Module 1.0 © 2012 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | MISRA C:2012 Rule Index | Contents |