Number is out of range

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

Number is out of range

912 Views
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 Kudos
2 Replies

737 Views
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 Kudos

737 Views
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 Kudos