I'm trying to initialize a static const array of the struct:
typedef struct{
UINT8 id_array[3];
} __attribute__((packed, aligned(1))) ST_ID;
I do the init as follows:
static const ST_ID msg_ids[3] =
{
/* Category A: Protocols */
{0x8A, 0x01, 0x01}, \
{0x8A, 0x02, 0x00}, \
{0x8A, 0x03, 0x00}, \
};
i get warnings during compiling:
'note: (near initialization for ‘msg_ids' and 'warning: missing braces around initializer [-Wmissing-braces]'
and the values in run time are not correct!!
and the values in run time are not correct!!...minimal reproducible example please.UINT8? Don't use homebrew fixed-width types. Use the standard types instead.