Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A signed bit field of 1 bit length is not useful
#2
The rule is sort of sarcastic... It assumes you know enough of programming to just laugh and nod when you read it. What you can read between the lines is that the sign bit itself takes up one bit alone, and that it doesn't make sense to create a variable which is either "minus" or "not minus".

Also, the rule can't advise of how a compiler will react when presented with such a variable, since bit-fiends are incredibly poorly specified by the standard. Everything about them is unspecified- or implementation-specific behavior... one's complement or two's complement? First bit of the struct, lsb or msb? Big or little endian? Then there are non-standard extensions that allow other types than int...
<t></t>
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)