0

I used the code below. The IAR code screen has a vertical line after the 80th. In the code below, there is a vertical line before the "src" variable.

__STATIC_INLINE void orderedCpy(volatile uint32_t* dst, const uint32_t* __RESTRICT src, uint32_t len)
{
  uint32_t i;
  for (i = 0U; i < len; ++i) 
  {
    dst[i] = src[i];
  }
}

Then, error this below

Error[Pe018]: expected a ")"  
Error[Pe020]: identifier "len" is undefined  
Error[Pe020]: identifier "src" is undefined 

But if I change the location of the "len" variable setting as below, The "len" variable comes to the left of the vertical line

__STATIC_INLINE void orderedCpy(volatile uint32_t* dst, uint32_t len, const uint32_t* __RESTRICT src)
{
  uint32_t i;
  for (i = 0U; i < len; ++i) 
  {
    dst[i] = src[i];
  }
}

Then, error is changed as this below. "len" has been defined.

Error[Pe018]: expected a ")"  
Error[Pe020]: identifier "src" is undefined 

Why IAR can't read after 80th character in this condition?

delisting
  • 9
  • 3

1 Answers1

0

I found the answer! IAR v7 can't take "_RESTRICT". so I'v change 'cmsis_iccarm.h' like as below

#ifndef   __RESTRICT
  #if __ICCARM_V8
    #define __RESTRICT            __restrict
  #else
    #define __RESTRICT
  #endif
#endif
delisting
  • 9
  • 3