ARMCC 中implicit cast of pointer to non-equal pointer的原因

来源:互联网 发布:ff14捏脸数据 雷霆 编辑:程序博客网 时间:2024/04/30 22:36

ADS的C编译器真是有点啊。。

unsinged char *str="ifqif.qifqq";

这样的声明都不能自己转换一下啊。今天在声明一个字符串数组的时候总是报错。

unsigned char vga640480[] =
 {
  0x61,0x02,0x0b,0x00,0x20,0x37,0x10,0x8c,
  0x01,0x69,0x30,0x20,0x05,0x03,0x1b,0x15,
  0x00,0xcb,0xff,0x40,0x3f,0x7e,0x0d,0x40,
  0x62,0x00,0x68,0x00,0xf0,0x00,0x00,0x00,
  0x0a,0x01,0x00,0x00,0x01,0x32,0x00,0x00,
  0x00,0x00,0x54,0x01,0xae,0xae,0xd7,0x81,
  0x08,0xfa,0xfa,0x1f,0x0f,0xfa,0xfa,0x03,
  0xfc,0x00,0x00,0x0f,0x0f,0x00,0x00,0x3f
 };

unsigned char *(display_mode[2][2]) =
{
  {0, 0},
  {vga640480, "VGA 640X480"},

}

Error   : C3028E: '=': implicit cast of pointer to non-equal pointer
vga.c line 58  

最后改为

unsigned char *(display_mode[2][2]) =
{
  {0, 0},
  {vga640480, (unsigned char *)"VGA 640X480"},

}

编译通过。

真是死板的要命哈。

原创粉丝点击