I just wanted to cross check an answer to something I came across on the web.
c++ faq - What does the C++ standard state the size of int, long type to be? - Stack Overflow
In the answers they give a range of numbers which the variables have to be. If I convert these variables into HEX will it give my how big the variables are in bytes?
Solved! Go to Solution.
Hello Jorge
For MK10DX256VLH7, CodeWarrior v10.6.4 includes both GCC compiler and Freescale compiler.
In general, the data type information should be included in the compiler manual for each MCU platform.
But, in the documents in CW 10.x, this manual does not include such information. I need report it to the document team.
For the data type information of Kinetis, you can get it from attached header file limits_api.h
(it locates at:
{cw 10.x}MCU\ARM_GCC_Support\ewl\EWL_C\include
{cw 10.x}MCU\ARM_EABI_Support\ewl\EWL_C\include
).
From them, we can get the size for data type is:
char – 8 bit
short – 2 bytes
int – 4 bytes
long – 4 bytes
long long – 8 bytes
Fiona Kuang
Technical Information & Commercial Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello Jorge
The size of data type is determined by processor architecture and the compiler, what is the part number of your target MCU? And what development environment you are using?
Fiona Kuang
Technical Information & Commercial Support
MCU: MK10DX256VLH7
IDE: Codewarrior 10.6.4
Hello Jorge
For MK10DX256VLH7, CodeWarrior v10.6.4 includes both GCC compiler and Freescale compiler.
In general, the data type information should be included in the compiler manual for each MCU platform.
But, in the documents in CW 10.x, this manual does not include such information. I need report it to the document team.
For the data type information of Kinetis, you can get it from attached header file limits_api.h
(it locates at:
{cw 10.x}MCU\ARM_GCC_Support\ewl\EWL_C\include
{cw 10.x}MCU\ARM_EABI_Support\ewl\EWL_C\include
).
From them, we can get the size for data type is:
char – 8 bit
short – 2 bytes
int – 4 bytes
long – 4 bytes
long long – 8 bytes
Fiona Kuang
Technical Information & Commercial Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------