Different struct size in S12X and XGATE code

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Different struct size in S12X and XGATE code

3,098 次查看
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?
标签 (1)
0 项奖励
回复
2 回复数

838 次查看
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 项奖励
回复

838 次查看
pittbull
Contributor III
Hello,
Thanks very much. That's what I need :smileyhappy:
0 项奖励
回复