TI E2E Community
TI C/C++ Compiler
TI C/C++ Compiler - Forum
Size of int for EABI
Am using CCS V5.2.0.00069, TI MSP430 compiler V4.1.1, eabi, small code & data model (set via Properties>MSP430 Compiler>Processor Options). I would have expected int to be 32 bits, per Table 5-2 "MSP430 C/C++ EABI Data Type" of the "MSP430 Optimizing C/C++ Compiler v 4.1 Beta User's Guide SLAU132G". However, int seems to be only 16 bits, as indicated by this snippet of the .asm output of a test program:
test_val = sizeof (char); MOVX.A #1,&test_valtest_val = sizeof (int); MOVX.A #2,&test_val <------ expect #4test_val = sizeof (long); MOVX.A #4,&test_valtest_val = sizeof (long long); MOVX.A #8,&test_val
Also __TI_EABI__ does not seem to be defined either. Has the compiler has defaulted to COFF (and 16-bit int) despite the EABI setting? Am I missing the obvious here, or is there some additional setting that's needed?
For COFF ABI, type int is represented by 16 bits, so you have probably managed to invoke the compiler in COFF mode. That is further corroborated by __TI_EABI__ not being defined. Check the setting for Properties/General/Advanced/Output Format for your target configuration.
The size of int is 16 bits in both COFF ABI and EABI. Table 5-2 is in error. It is also incorrect about the size of pointers.
Thanks for the quick responses. Life is a lot easier when int is the same size for EABI as for COFF.
Correction: Due to an artifact of colour shading in the CCS editor, I initially thought that __TI_EABI_ was not being defined; however, it is being defined and is correctly set to 1.
But the documentation appears to remain in error.
An effort should be made to publish corrections, particularly for such an important element as this.
I second that - seems like an email to the documentation department would take care of it. Any TI people have a few minutes to take care of this?
This issue was filed as defect report SDSCM00045021 on 2012-08-09.
I'll let someone else comment on the frequency of documentation updates.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.