在MDK 中忽略(suppress) 某一个警告

有时候我们需要在MDK中忽略掉某一个具体的warnning,怎么做呢?
只需在Misc Control中添加  “--diag_suppress=<num>” 就可以了, num就是Keil中的警告代码,,比如在工程中需要忽略..\..\..\..\src\drivers\gpio\gpio.h(169): warning:  #61-D: integer operation result is out of range 这个警告,只需添加  --diag_suppress=61,如下图所示:

我自己的截图:

..\Bsp\DAC8562\dac8562.c(307): warning: #177-D: variable "cmd" was declared but never referenced

..\App\global\global.c(102): warning: #69-D: integer conversion resulted in truncation——这里没有屏蔽
testValue = 0xaacc;
..\App\global\global.c(73): warning: #550-D: variable "addr" was set but never used
uint32_t addr = 0;
..\Bsp\IO_driver\IO_driver.c(1699): warning: #188-D: enumerated type mixed with another type

 

posted @ 2020-03-02 14:32  wdliming  阅读(1249)  评论(0编辑  收藏  举报