Different struct size in S12X and XGATE code

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Different struct size in S12X and XGATE code

3,093 Views
pittbull
Contributor III
Hello,
I have a header file that contains a struct declaration. This file is #included in both, S12X and XGATE codes. When I build them, the linker shows a warning message, something like "object 'x' has different size in a.c and b.cxgate". I think it is because XGATE needs struct members at even boundaries whereas S12 can access them from any address. Is there a #pragma to force structs to even boundaries?
Labels (1)
0 Kudos
Reply
2 Replies

833 Views
Sten
Contributor IV

The following is an quote from the CW for S12 v. 4.5 help file:

#pragma align  (on|off)
Synonym

None.

Arguments

on: the HCS12X compiler uses the same alignment as the XGATE compiler
off: the HCS12X compiler uses no alignment

 

0 Kudos
Reply

833 Views
pittbull
Contributor III
Hello,
Thanks very much. That's what I need :smileyhappy:
0 Kudos
Reply