![]() |
![]() |
1812 | ![]() |
||||
![]() | |||||||
| Arithmetic type - Balancing | |||||||
This message is issued whenever an expression of essentially character type is subtracted from an expression of essentially unsigned type. For example:
/*PRQA S 1-9999 ++*/
/*PRQA S 1812 --*/
unsigned f1812 (unsigned a, char b)
{
b = b - a; /* OK, essential type of RHS is char */
return a - b; /* 1812 */
}
MISRA C:2012 Rules applicable to message 1812:
| Rule-10.2 (Required) | Expressions of essentially character type shall not be used inappropriately in addition and subtraction operations |
![]() | ||
| 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 |