This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Error #256 typename not allowed only appears in for loop

Other Parts Discussed in Thread: TMS320F28379D

Hey, this is the first time I've ever encountered something like this. What's more interesting to me is that I moved this code snippet to another compiler and the compilation went smoothly. Could you at least direct me where to look for a solution to the problem?

This works without error:

static inline uint16_t calc_crc16(const uint16_t * data,
                                  const uint16_t length)
{
    uint16_t tmp;
    uint16_t crc = 0U;
    uint16_t i = 0U;

    for(; i < length; i++)
    {
        tmp = (*data++ ^ crc);
        crc >>= 8;
        crc ^= crc16_table[tmp & 0x00ffU];
    }
    ...
}

And this is not working:

static inline uint16_t calc_crc16(const uint16_t * data,
                                  const uint16_t length)
{
    uint16_t tmp;
    uint16_t crc = 0U;
    
    for(uint16_t i = 0U; i < length; i++)
    {
        tmp = (*data++ ^ crc);
        crc >>= 8;
        crc ^= crc16_table[tmp & 0x00ffU];
    }
    ...
}