[previous] 1861 [next] The operands of this bitwise operator are of different 'essential signedness' but will generate a result of type 'signed int'.
Arithmetic type - Balancing

The operands of this &, | or ^ operator are of different essential type categories; one is 'essentially signed' and the other is 'essentially unsigned'. Both essential types are of lower rank than type int but the result of the operation will be of type int because of integral promotion.

For example:


/*PRQA S 1-9999 ++*/
/*PRQA S 1861 --*/

int f1861 (signed char a, unsigned char b)
{
  return (a & b);           /* 1861 */
}

QA·C Source Code Analyser 8.1.2
© 2013 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index Contents