代码
static int CheckOneReg(uint8_t busNo, char *title, int32_t addr, uint32_t *val, BOOL isPrintfNL, ErrMsg_t const *pMsg)
res |= CheckOneReg(busNo,"fwVer:", HALREG_FW_VER, &val, true, NULL);
res |= CheckOneReg(busNo, "status-0:", HALREG_SYS_STATUS_0 + 0, &val, true, MsgTbl_a3SysStatus);
报如下错误:
ptr2ptr.cpp:224:86: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
res |= CheckOneReg(busNo, (const char *)"fwVer:", HALREG_FW_VER, &val, true, NULL);
^
ptr2ptr.cpp:225:99: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
res |= CheckOneReg(busNo, "status-0:", HALREG_SYS_STATUS_0 + 0, &val, true, MsgTbl_a3SysStatus);
解决方法
改为:
static int CheckOneReg(uint8_t busNo, char const *title, int32_t addr, uint32_t *val, BOOL isPrintfNL, ErrMsg_t const *pMsg)