Re: Bit field ordering on Big-Endian (SPARC) processor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Paweł Sikora-2 wrote
> iirc, the C language gives no guarantee of the ordering of fields within
> machine words,
> so if you use them for the h/w register modeling, you program will not
> only be nonportable,
> it will be compiler-dependent too. you should really read suitable
> byte/word/doubleword
> from mapped h/w memory, convert it with le/be_to_cpu() method and
> shift/mask to access bits.

But here __attribute__ ((__packed__)) has been used. Doesn't it have any
effect? Or are we missing out the ordering compiler is enforcing? Isn't it
surprising that on Little Endian system the ordering is as we expect, while
in Big-Endian system, no apparent correlation is being found?



--
View this message in context: http://gcc.1065356.n5.nabble.com/Bit-field-ordering-on-Big-Endian-SPARC-processor-tp896566p896649.html
Sent from the gcc - Help mailing list archive at Nabble.com.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux