[previous] 4542 [next] A non-negative constant expression of 'essentially signed' type (%1s) is being used as the %2s operand of this bitwise operator (%3s).
Arithmetic type - Operands

This message is issued whenever a constant expression of essentially signed type with a non-negative value has been used as an operand of a bitwise operator.

For example:


/*PRQA S 1-9999 ++*/
/*PRQA S 4542-4544 --*/

void f4542 (unsigned a)
{
  1 & a;                    /* 4542 */
  
  1 | a;                    /* 4542 */
  
  ~0;                       /* 4542 */

  2 >> a;                   /* 4543 */

  a << 1;                   /* 4544 */
}

See also:

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