Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A signed bit field of 1 bit length is not useful
#3
The use of a single bit is illogical on a target adopting two’s complement representation. The intention of the programmer may have been to allow for values of -1 and +1 (as well as zero), but such data values clearly require at least 2 bits (which in turn actually provides a range of -2 to +1). The ISO C standard does not define the required behaviour for a signed bit field of length 1.

Tracker ID: 17
Posted by and on behalf of the MISRA C Working Group
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)