Topic : Complirer error on typedef struct

Forum : ST7/STM8

Original Post
Post Information Post
January 21, 2013 - 10:07pm
Guest

It looks compiler fails to accept arrays withing typedf struct:

typedef struct
{
uint8_t pid;
uint8_t data[4]; // <-- fails to accept array here. Normal single variable would compile ok
uint16_t cksum;
} Frame;
extern Frame myframe;

Can somebody confirm such behavior? And if so what is the way around?
To my knowledge in ANSI C it should work.

Replies
Post Information Post
+1
0
-1
January 22, 2013 - 5:15pm
Raisonance Support Team

Hello,

data is a key word for our compiler that's why it fails.
If you replace "data" by "_data", it should work.

regards,

Etienne