warning: missing braces around initializer

来源:互联网 发布:怎么改淘宝会员名 编辑:程序博客网 时间:2024/06/05 15:04

warning: missing braces around initializer
这主要发生在结构体中多维或多个数组初始化的时候,其错误发生的原因是没有用大括号明确的区分出初始化数据的归类,改正的方法如下例子:
struct chinese_12_12        // 12*12汉字字模数据结构
{
    unsigned char Index[2];
    unsigned char Msk[24];
};
const struct chinese_12_12 ch_12_12[] PROGMEM=
{
{{"武"}, {0x01,0x80,0x7D,0x40,0x01,0x40,0xFF,0xE0,
 0x11,0x00,0x51,0x00,0x5F,0x00,0x51,0x00,
 0x50,0xA0,0x5E,0xA0,0xE0,0x60,0x00,0x00}},

{{"汉"}, {0x40,0x40,0x2F,0xE0,0x04,0x40,0x94,0x40,
 0x54,0x80,0x22,0x80,0x22,0x80,0xC1,0x00,
 0x42,0x80,0x44,0x40,0x58,0x20,0x00,0x00}}
};

原创粉丝点击