[英]Vs code warnings in C
我對如何在我的系統中配置VS Code
以顯示警告感到困惑:
C/C++
IntelliSense,調試(已安裝)// C 代碼:
#include <stdio.h>
int main()
{
int a;
printf("%d", a);
}
在這種情況下,我應該得到: 'a'
is used uninitialized,我怎樣才能得到所有警告?
我找到了答案,在文件 task.json 中添加“-Wall”如果文件 task.json 不是由 VS Code 自動生成的,則可以手動添加:
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: gcc.exe build active file",
"command": "C:\\msys64\\mingw64\\bin\\gcc.exe",
"args": [
"-Wall",
"-fdiagnostics-color=always",
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe",
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Task generated by Debugger."
}
],
"version": "2.0.0"
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.