[EXT_EP-9216] ltoa definition conflicts with quasi-standard ltoa Created: 08/Jun/15  Updated: 11/Aug/20  Resolved: 11/Aug/20

Status: Fixed
Project: Embedded Software & Tools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Medium
Reporter: TI User Assignee: TI User
Resolution: Fixed Votes: 0
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Product: Code Generation Tools
Internal ID: CODEGEN-1154
OldID: SDSCM00052006
Found In Release: ARM_5.2.4
C2000_16.9.0.LTS
C6000_8.2.0
C6000_8.3.0
ARM_18.12.0.LTS
PRU_2.3.0
ARP32_1.1.0*
ARM_18.1.0.LTS
MSP430_18.1.0.LTS
ARM_16.9.0.LTS
C6000_8.1.0B1
MSP430_18.12.0.LTS
MSP430_16.9.0.LTS
C2000_18.12.0.LTS
Fix In Release: C2000_19.6.0.STS
PRU_2.3.2
C6000_8.3.3
ARM_19.6.0.STS
C6000_8.2.6
ARP32_1.1.0*
MSP430_19.6.0.STS
Workaround: Potential workarounds:
1) Avoid using ltoa, which is not a standard C function. You can use sprintf instead.
2) At every call site, check whether the compiler is a version of the TI compiler with the incorrect definition:
#if defined(__TI_COMPILER_VERSION__) && \
    (((defined(__TI_ARM__) || defined(__MSP430__) || defined(__TMS320C2000__)) && __TI_COMPILER_VERSION__ < 19006000) || \
     (defined(__ARP32__) && __TI_COMPILER_VERSION__ < 1001000) || \
     (defined(__PRU__) && __TI_COMPILER_VERSION__ < 2003002) || \
     (defined(__TMS320C6X__) && __TI_COMPILER_VERSION__ < 8002006) || \
     (defined(__TMS320C6X__) && __TI_COMPILER_VERSION__ >= 8003000 && __TI_COMPILER_VERSION__ < 8003003))
    ltoa(1234, buffer);
#else
    ltoa(1234, buffer, 10);
#endif
Release Notes: For a long time, the TI RTS has defined a function named ltoa, with a prototype in stdlib.h, for use as a helper function in printf. However, there was already a quasi-standard function ltoa with a different prototype which had been floating around the net for even longer. The presence of TI's definition causes a "too many arguments" error or "incompatible redeclaration" error for applications which attempt to use the quasi-standard ltoa.

This defect has been resolved by renaming TI's ltoa to something in the implementation namespace. Additionally, we've added a definition of ltoa conforming to the quasi-standard version.

 Description   

For a long time, the TI RTS has defined a function named ltoa, with a prototype in stdlib.h, for use as a helper function in printf. However, there was already a quasi-standard function ltoa with a different prototype which had been floating around the net for even longer. The presence of TI's definition causes a "too many arguments" error or "incompatible redeclaration" error for applications which attempt to use the quasi-standard ltoa.

This defect has been resolved by renaming TI's ltoa to something in the implementation namespace. Additionally, we've added a definition of ltoa conforming to the quasi-standard version.


Generated at Sat Dec 13 11:31:02 CST 2025 using Jira 10.3.7#10030007-sha1:a563685562f94d165eb4e158cfb2a142338d8c54.