[EXT_EP-8580] libcxx/include/random uses unsigned for unsigned long Created: 17/Jan/18  Updated: 28/Jun/22

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

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

Product: Code Generation Tools
Internal ID: CODEGEN-4318
Found In Release: MSP430_18.1.0.LTS
C2000_22.6.0.LTS
MSP430_20.2.0.LTS
MSP430_21.6.0.LTS
C2000_21.6.0.LTS
MSP430_18.12.0.LTS
Release Notes: LIBCXX/libcxx/include/random shown below uses unsigned instead of unsigned long for the "32" bit case of __lce_ta:

// 32
template <unsigned long long _Ap, unsigned long long _Cp, unsigned long long _Mp>
struct __lce_ta<_Ap, _Cp, _Mp, (unsigned long)(~0), true>
{
    typedef unsigned long result_type;
...

armcl/clang both compile with no errors.

msp430, however, has 16bit "unsigned" and fails with below error due to above issue where "unsigned" is used for 32 bit. It should use unsigned long instead:

"random", line 1890: error: incomplete type is not allowed
          detected during:
            instantiation of "std::__2::linear_congruential_engine<_UIntType, __a, __c, __m>::result_type std::__2::linear_congruential_engine<_UIntType, __a, __c, __m>::operator()() [with _UIntType=uint_fast32_t, __a=40014UL, __c=0UL, __m=2147483563UL]" at line 2651
            instantiation of "void std::__2::subtract_with_carry_engine<_UIntType, __w, __s, __r>::seed(std::__2::subtract_with_carry_engine<_UIntType, __w, __s, __r>::result_type, std::__2::integral_constant<unsigned int, 1U>) [with _UIntType=uint_fast32_t, __w=24UL, __s=10UL, __r=24UL]" at line 2576

Tests compile and pass if above __lce_ta is changed for 32bit case from unsigned to unsigned long.

 Description   

libcxx/include/random uses unsigned for unsigned long


Generated at Wed Apr 02 06:01:48 CDT 2025 using Jira 9.12.17#9120017-sha1:aba4002bcd633f188b6a4bb5dd8a0e1f20b79ee4.