Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Clarification of Rationale for Rule 10.8
#1
Rule 10.8 Rationale 3rd paragraph,

"On a 16-bit machine the addition will be performed in 16 bits with the
result wrapping modulo-2 before it is cast to 32 bits."

It will be understood that.

"On a 16-bit machine the addition will be performed in 16 bits with the
result wrapping like modulo-2 before it is cast to 32 bits."

or

"On a 16-bit machine the addition will be performed in 16 bits with the
result wrapping modulo-2^16 before it is cast to 32 bits."

Which do you prefere?
<t>Dr. OGAWA Kioshi<br/>
@kaizen_nagoya</t>
#2
We agree that the following wording would be clearer.

“ On a 16-bit machine the addition will be performed in 16 bits with the result wrapping modulo-2^16 before it is cast to 32 bits.”

where "^" means "raise to the power of"
Posted by and on behalf of the MISRA C Working Group


Forum Jump:


Users browsing this thread: 2 Guest(s)