Number is out of range

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

Number is out of range

1,119 次查看
gordonp
Contributor III

I am using CodeWarrior 10.7 to write an application for an S12Z processor. I have enabled C99 and GCC extensions. However, if I declare a variable of unsigned long long (i.e. uint64_t) and try to assign a value of greater than 0xFFFFFFFFF to it I get a "number is out of range " error when I build the code. Is there some other build setting that I have overlooked?

0 项奖励
回复
2 回复数

944 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi

When create a new S12Z project, we can select either of these two options, which will enable ansidr.lib or ansidm.lib linking to the project, setting llong_size=8

pastedImage_1.png

See my attached testing video.


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复

944 次查看
gordonp
Contributor III

I've just found the compiler manual http://www.nxp.com/assets/documents/data/en/reference-manuals/CWMCUS12ZCMPREF.pdf , and it would appear that 64 bit integers are not supported. Unsigned long is 32 bits, unsigned long long is also 32 bits. However, they are if you set up the project to use the floating point libraries!

0 项奖励
回复