Reputation: 180
I've got confused about how to configure VS Code
to show warnings, in my system:
C/C++
IntelliSense, debugging (installed)// C code:
#include <stdio.h>
int main()
{
int a;
printf("%d", a);
}
In this case, I should get: 'a'
is used uninitialized, how I can get all warnings?
Upvotes: 1
Views: 1528
Reputation: 180
I found the answer, Add "-Wall" in the file task.json located in the folder .vscode If the file task.json is not automatically generated by VS Code you can add it manually:
{
"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"
}
Upvotes: 2