Announcement

Collapse
No announcement yet.

Bitfield bit order

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bitfield bit order

    It appears that the gcc compiler for the xport puts bitfield bits in the opposite order from the gcc compiler for avr and ubuntu

    This is a problem, since I am receiving a binary communication from an existing avr based system that cannot be changed

    Does anybody know how to get gcc to put the bits in the correct order?

  • #2
    Consider reworking your code to bit masking from bitfields.
    Bitfields are not considered portable across platforms and compilers are free to use any size field or order.

    Comment


    • #3
      Yes, that's a very common reply that I have seen when searching for the answer

      And yes, I have coded a workaround that allows the project to proceed

      My question still stands

      Is there a way to make gcc put the bits in the expected order?

      Comment

      Working...
      X