在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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM