This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]