• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Development Tools » TI C/C++ Compiler » TI C/C++ Compiler - Forum » Size of int for EABI
Share
TI C/C++ Compiler
  • Forum
Options
  • Subscribe via RSS

Size of int for EABI

Size of int for EABI

This question is answered
Peter W
Posted by Peter W
on Aug 08 2012 19:04 PM
Prodigy30 points

Hi, folks,

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_val
test_val = sizeof (int);                MOVX.A  #2,&test_val  <------ expect #4
test_val = sizeof (long);            MOVX.A  #4,&test_val
test_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?

Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Douglas Gwyn
    Posted by Douglas Gwyn
    on Aug 09 2012 01:27 AM
    Expert2060 points

    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.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Archaeologist
    Posted by Archaeologist
    on Aug 09 2012 09:06 AM
    Verified Answer
    Verified by Peter W
    Mastermind40550 points

    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.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Peter W
    Posted by Peter W
    on Aug 09 2012 12:01 PM
    Prodigy30 points

    Hi, folks,

    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.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Mark Richards
    Posted by Mark Richards
    on Jan 07 2013 07:50 AM
    Intellectual935 points

    But the documentation appears to remain in error.

    An effort should be made to publish corrections, particularly for such an important element as this.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Erik Stafl
    Posted by Erik Stafl
    on Mar 29 2013 17:56 PM
    Prodigy90 points

    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?

    Thanks,

    Erik

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Archaeologist
    Posted by Archaeologist
    on Mar 29 2013 18:35 PM
    Mastermind40550 points

    This issue was filed as defect report SDSCM00045021 on 2012-08-09.

    I'll let someone else comment on the frequency of documentation updates.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

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.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use