Clarification for 5-0-20 (operands to a binary bitwise operator)

Moderators: david ward, misra cpp

Post Reply
udi
Posts: 9
Joined: Wed May 11, 2016 8:24 am
Company: Elbit

Clarification for 5-0-20 (operands to a binary bitwise operator)

Post by udi » Tue Feb 05, 2019 3:52 pm

Hi,

Just to clarify what seems to be a mistake in the implementation of the static analysis tool I use:
According to the rationale, I believe that this rule does not refer to the shift operators, but only to following 6 operators:
&
|
^
&=
|=
^=
Am I right about this?

Thanks,
Udi.

misra cpp
Posts: 145
Joined: Mon Jun 02, 2008 1:55 pm
Company: MISRA

Re: Clarification for 5-0-20 (operands to a binary bitwise operator)

Post by misra cpp » Wed Apr 10, 2019 2:49 pm

We agree that it is undesirable for 5-0-20 to apply to shift operators, however the current wording may be regarded as ambiguous and could be taken to include shifts. This is being looked at for the next version.
Posted by and on behalf of
the MISRA C++ Working Group

Post Reply

Return to “6.5 Expressions (C++)”