Bit field ordering on Big-Endian (SPARC) processor
Holmes.Sherlock
its.dipanjan.das@gmail.com
Tue Dec 11 17:12:00 GMT 2012
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.
More information about the Gcc-help
mailing list