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

32-bit addition with pointer cast to unsigned long as input causes compilation failure for MSP430

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low
    • Code Generation Tools
    • CODEGEN-9579
    • MSP430_21.6.0.LTS
    • default
    • Hide
      This appears to be related to casting a pointer to an integer value and then using it in an addition expression. The workaround would be to separate the cast and the addition. Given:

      extern short array[];

      unsigned long func(unsigned long x)
      {
          return (unsigned long)array + x;
      }

      change it to

      unsigned long func(unsigned long x)
      {
          volatile unsigned long y = (unsigned long)array;
          return y + x;
      }

      Show
      This appears to be related to casting a pointer to an integer value and then using it in an addition expression. The workaround would be to separate the cast and the addition. Given: extern short array[]; unsigned long func(unsigned long x) {     return (unsigned long)array + x; } change it to unsigned long func(unsigned long x) {     volatile unsigned long y = (unsigned long)array;     return y + x; }
    • No plans to address at this time.

      Casting a pointer to an unsigned long integer value and then using it in an addition expression causes a compilation failure.

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

              Created:
              Updated: