工具与软件:
尊敬的专家:
当我的客户使用 mspm0_sdk 编译软件时、他发现许多警告。
CCS:v12.8.0
SDK:v2.01.00.03
问题1:如果用户可以修复(删除)这些警告、您能否告诉我如何修复?
问题2:此外、是否有计划在 SDK 中修复这些警告?
由于这包含客户信息、因此仅摘录了错误内容。
#1 main.c:364:10: warning: passing argument 1 of 'memset' discards 'volatile' qualifier from pointer target type [-Wdiscarded-qualifiers] 364 | memset( s_aEventBuffer, 0U, sizeof( s_aEventBuffer ) ); | ^~~~~~~~~~~~~~ #2 gcc-arm-none-eabi-9-2019-q4-major/arm-none-eabi/include/string.h:33:9: note: expected 'void *' but argument is of type 'volatile SCommonEventData *' {aka 'volatile struct <anonymous> *'} 33 | void * memset (void *, int, size_t); | ^~~~~~ #3 main.c:571:29: warning: cast from function call of type 'uint32_t' {aka 'long unsigned int'} to non-matching type 'double' [-Wbad-function-cast] 571 | byRetVal = (uint8_t) ceil( (double) getVoltage() / VOLTAGE ); | ^ #4 main.c:571:13: warning: cast from function call of type 'double' to non-matching type 'unsigned char' [-Wbad-function-cast] 571 | byRetVal = (uint8_t) ceil( (double) getVoltage() / VOLTAGE ); | ^ #5 I2C.c:57:61: warning: passing argument 2 of 'DL_I2C_fillTargetTXFIFO' discards 'volatile' qualifier from pointer target type [-Wdiscarded-qualifiers] 57 | byFIFOWriteSize = DL_I2C_fillTargetTXFIFO( LPI2C2_INST, &s_pSendData[s_bySendIndex], | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ #6 dl_i2c.h:980:57: note: expected 'uint8_t *' {aka 'unsigned char *'} but argument is of type 'volatile uint8_t *' {aka 'volatile unsigned char *'} 980 | uint8_t DL_I2C_fillTargetTXFIFO(I2C_Regs *i2c, uint8_t *buffer, uint8_t count); | ~~~~~~~~~^~~~~~ #7 startup_mspm0l130x_gcc.c:58:6: warning: no previous prototype for 'initStub' [-Wmissing-prototypes] 58 | void initStub(void){;}
此致、
棒极了 h