Reg: #pragma pack(n) and Endianness - DIAB-to-GCC Porting

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

 



Hi All,

I have a porting issue related with the migration to GCC from DIAB compiler.
The RTOS used is AMX and the platform is PowerPC. The code earlier compiled
with Diab has the following pragma usage

DIAB:
-----
#pragma pack [ ([[max_member_alignment], [min_structure_alignment] [,
byte-swap]]) ]
where byte-swap  means: 	
      If 0 or absent, bytes are taken as is. If 1, bytes are swapped when
the data is transferred between byte-swapped members and registers or
non-byte-swapped memory. This enables access to little-endian data on a
big-endian machine and vice-versa. 
(w.ref.to http://www.vxdev.com/docs/vx55man/diab5.0ppc/c-additi.htm#3000472
: page 132)
-----
GCC ignores the usage #pragma pack(1, 1, 0) and #pragma pack(1, 1, 1) at
several places related with structures of different packet types avoiding
structure packing. I can manage with #pragma pack(1) while using GCC, but I
am concerned how the third parameter 'byte-swap' specifying the 'endianness'
can affect the code behaviour. Is there any way we can mention this
endianness also? Can anyone please share your thoughts on this?

Thanks-in-advance,
-Praveen.
-- 
View this message in context: http://old.nabble.com/Reg%3A--pragma-pack%28n%29-and-Endianness---DIAB-to-GCC-Porting-tp29997586p29997586.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