【原创】arm-linux-gcc “missing braces around initializer”编译错误处理
来源:互联网 发布:3g4g软件开发 编辑:程序博客网 时间:2024/06/05 21:02
【原创】arm-linux-gcc “missing braces around initializer”编译错误处理
Author: chad
Mail: linczone@163.com
本文可以自由转载,但转载请务必注明出处以及本声明信息。
程序编译出现如下错误:
db_app.c:24: warning: missing braces around initializer
db_app.c:24: warning: (near initialization for ‘MeterEventData[0]’)
数组原型如下:
//-----------------20140217-------------------------------------const char* MeterEventData[][2] ={ "","", "id","integer primary key", "point","integer NOT NULL DEFAULT 0",//测量点号 "addr","text NOT NULL DEFAULT '000000000000'",//表地址 "type","integer NOT NULL DEFAULT 0",//表类型,三相或单相表 "TimeScale","date",//数据时标-日期标识 "CmdBitMap","text NOT NULL DEFAULT '000000'",//数据有限性标识 "PowerLostTimes","integer",//失压总次数 "PowerLostRecord","blob",//失压总记录 "AllPowerLostTimes","integer",//全失压总次数 "AllPowerLostRecord","blob",//全失压记录 "OffPhaseTimes","integer",//断相总次数 "OffPhaseRecord","blob",//断相记录 "SwitchErrorTimes","integer",//负荷开关误动作总次数 "SwitchErrorRecord","blob",//负荷开关误动作记录 "MeterRunWorld","blob",//运行状态字 "VUnbalancedTimes","integer",//电压不平衡总次数 "VUnbalancedRecord","blob",//电压不平衡记录 "OpenLidTimes","integer",//开表盖总次数 "OpenLidRecord","blob",//开表盖记录 "ButtonUpTimes","integer",//开端钮盖总次数 "ButtonUpRecord","blob",//开端钮盖记录 "MagneticFieldAbnormalTimes","integer",//电能表磁场异常总次数 "MagneticFieldAbnormalRecord","blob",//磁场异常记录 "TimingTimes","integer",//电能表校时总次数 "TimingRecord","blob",//电能表校时记录 "ClearMeterTimes","integer",//电能表清零总次数 "ClearMeterRecord","blob",//电能表清零记录 "ClearDemandTimes","integer",//需量清零总次数 "ClearDemandRecord","blob",//需量清零记录 "ClearEventTimes","integer",//事件清零总次数 "ClearEventRecord","blob"//事件清零记录 };
但是在ubuntu虚拟机上使用gcc测试如下程序没有任何问题:
后来,经数组修改为如下形式后问题解决:
//-----------------20140217-------------------------------------const char* MeterEventData[][2] ={ {"",""}, {"id","integer primary key"}, {"point","integer NOT NULL DEFAULT 0"},//测量点号 {"addr","text NOT NULL DEFAULT '000000000000'"},//表地址 {"type","integer NOT NULL DEFAULT 0"},//表类型,三相或单相表 {"TimeScale","date"},//数据时标-日期标识 {"CmdBitMap","text NOT NULL DEFAULT '000000'"},//数据有限性标识 {"PowerLostTimes","integer"},//失压总次数 {"PowerLostRecord","blob"},//失压总记录 {"AllPowerLostTimes","integer"},//全失压总次数 {"AllPowerLostRecord","blob"},//全失压记录 {"OffPhaseTimes","integer"},//断相总次数 {"OffPhaseRecord","blob"},//断相记录 {"SwitchErrorTimes","integer"},//负荷开关误动作总次数 {"SwitchErrorRecord","blob"},//负荷开关误动作记录 {"MeterRunWorld","blob"},//运行状态字 {"VUnbalancedTimes","integer"},//电压不平衡总次数 {"VUnbalancedRecord","blob"},//电压不平衡记录 {"OpenLidTimes","integer"},//开表盖总次数 {"OpenLidRecord","blob"},//开表盖记录 {"ButtonUpTimes","integer"},//开端钮盖总次数 {"ButtonUpRecord","blob"},//开端钮盖记录 {"MagneticFieldAbnormalTimes","integer"},//电能表磁场异常总次数 {"MagneticFieldAbnormalRecord","blob"},//磁场异常记录 {"TimingTimes","integer"},//电能表校时总次数 {"TimingRecord","blob"},//电能表校时记录 {"ClearMeterTimes","integer"},//电能表清零总次数 {"ClearMeterRecord","blob"},//电能表清零记录 {"ClearDemandTimes","integer"},//需量清零总次数 {"ClearDemandRecord","blob"},//需量清零记录 {"ClearEventTimes","integer"},//事件清零总次数 {"ClearEventRecord","blob"}//事件清零记录 };
0 0
- 【原创】arm-linux-gcc “missing braces around initializer”编译错误处理
- warning: missing braces around initializer
- warning: missing braces around initializer
- warning: missing braces around initializer
- [DEBUG]warning: missing braces around initializer
- C语言告警warning: missing braces around initializer详解
- error: braces around scalar initializer for type 'void*'编译错误解析
- arm-linux-gcc 编译
- arm-linux-gcc编译x264
- arm-linux-gcc编译x264
- arm-linux-gcc编译x264
- sizeof arm-linux-gcc 编译
- ARM-linux-gcc编译出错
- gcc arm-linux-gcc编译优化
- arm-linux-gcc 4.1.1 编译 QT 4.7 for ARM 中的错误
- 交叉编译工具[arm-linux-gcc and arm-elf-gcc]
- Linux 内核编译 出现错误 make:arm-none-linux-gnueabi-gcc:命令未找到
- 建立arm-linux-gcc交叉编译环境
- Flask-SQLAlchemy配置MySQL及其相关操作
- 使用栈进行进制的转换
- ios开发之故事板StoryBoard的使用
- 第十一周 项目一:存储班长信息的学生类(2)
- 第一个算法-简单不容易的二分查找
- 【原创】arm-linux-gcc “missing braces around initializer”编译错误处理
- JDK 转码工具 native2ascii 的使用
- 第11周-程序阅读5-多重继承
- 垃圾回收机制
- java中对日期处理
- Android中的选项菜单(OptionMenu)使用案例
- java-面对对象特性概要
- 深入剖析PHP输入流 php://input
- Java基础 eclipse基本功能说明