Uploaded image for project: 'Embedded Software & Tools'
  1. Embedded Software & Tools
  2. EXT_EP-8580

libcxx/include/random uses unsigned for unsigned long

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low
    • Code Generation Tools
    • CODEGEN-4318
    • Hide
      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
      Show
      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
    • Hide
      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.
      Show
      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.

      libcxx/include/random uses unsigned for unsigned long

            syncuser TI User
            syncuser TI User
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated: