-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Environment
- OS and Version: Windows 11 Version 24H2
- VS Code Version: 1.104.3
- C/C++ Extension Version: 1.27.7
- If using SSH remote, specify OS of remote machine: N/A (local build)
Bug Summary and Steps to Reproduce
Bug Summary: The C/C++ extension's IntelliSense engine does not show any warnings in the "PROBLEMS" tab, even when the compilerArgs in c_cpp_properties.json are set to enable them (-Wall, -Wextra, -Wconversion). The issue occurs on a completely clean installation of VS Code, the C/C++ extension, and the MinGW toolchain.
Steps to reproduce:
- Perform a full reset of VS Code (by renaming %APPDATA%\Code and %USERPROFILE%.vscode\extensions).
- Perform a clean install of the MSYS2 toolchain (pacman -S --needed base-devel mingw-w64-ucrt-x86_64-toolchain).
- Install only the official Microsoft C/C++ extension.
- Create a project with the following test.cpp file:
#include
#include
int main()
{
// -Wall Test: Unused variable.
int unused_variable;
// -Wextra Test: Comparing signed and unsigned integer.
std::vector<int> my_vector = {1, 2, 3};
int signed_int = -1;
if (signed_int < my_vector.size()) {}
// -Wconversion Test: Implicit conversion that loses data.
long long big_number = 9876543210LL;
int small_number = big_number;
(void)small_number;
}
- Create the corresponding .vscode/c_cpp_properties.json file.
- Open the test.cpp file and observe the "PROBLEMS" tab.
Expected behavior: The "PROBLEMS" tab should display three warnings (-Wunused-variable, -Wsign-compare, and -Wconversion) based on the compilerArgs.
Configuration and Logs
c_cpp_properties.json:
{
"configurations": [
{
"name": "Win32",
"includePath": ["${workspaceFolder}/**"],
"defines": [],
"compilerArgs": [
"-Wall",
"-Wextra",
"-Wconversion"
],
"compilerPath": "C:\\msys64\\ucrt64\\bin\\g++.exe",
"cppStandard": "gnu++23",
"intelliSenseMode": "windows-gcc-x64"
}
],
"version": 4
}
Logs from running C/C++: Log Diagnostics:
-------- Diagnostics - 10/8/2025, 12:47:58 AM
Version: 1.27.7
Current Configuration:
{
"name": "Win32",
"includePath": [
"c:/Users/mehul/OneDrive/Desktop/Coding/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"compilerArgs": [
"-Wall",
"-Wextra",
"-Wconversion"
],
"compilerPath": "C:\\msys64\\ucrt64\\bin\\g++.exe",
"cStandard": "gnu23",
"cppStandard": "gnu++23",
"intelliSenseMode": "windows-gcc-x64",
"compilerPathIsExplicit": true,
"cStandardIsExplicit": true,
"cppStandardIsExplicit": true,
"intelliSenseModeIsExplicit": true,
"recursiveIncludesReduceIsExplicit": false,
"recursiveIncludesPriorityIsExplicit": false,
"recursiveIncludesOrderIsExplicit": false,
"compilerPathInCppPropertiesJson": "C:\\msys64\\ucrt64\\bin\\g++.exe",
"mergeConfigurations": false,
"recursiveIncludes": {},
"browse": {
"limitSymbolsToIncludedHeaders": true
}
}
Additional Tracked Settings:
{
"editorTabSize": 4,
"editorInsertSpaces": true,
"editorAutoClosingBrackets": "languageDefined",
"filesEncoding": "utf8",
"filesAssociations": {
"iostream": "cpp",
"ostream": "cpp",
"list": "cpp",
"random": "cpp",
"cstdlib": "cpp",
"cmath": "cpp",
"numeric": "cpp",
"iosfwd": "cpp"
},
"filesExclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/.DS_Store": true,
"**/Thumbs.db": true
},
"filesAutoSaveAfterDelay": false,
"editorInlayHintsEnabled": true,
"editorParameterHintsEnabled": true,
"searchExclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/*.code-search": true
},
"workbenchSettingsEditor": "ui"
}
cpptools version (native): 1.27.7.0
Current database path: C:\USERS\MEHUL\APPDATA\LOCAL\MICROSOFT\VSCODE-CPPTOOLS\EAC14729FAC1AD3FDB629C1E532A6DE2\.BROWSE.VC.DB
Translation Unit Mappings:
[ C:\Users\mehul\OneDrive\Desktop\Coding\C++\Recursion\test.cpp - source TU]:
Translation Unit Configurations:
[ C:\Users\mehul\OneDrive\Desktop\Coding\C++\Recursion\test.cpp ]
Process ID: 5764
Memory Usage: 198 MB
Compiler Path: C:\msys64\ucrt64\bin\g++.exe
Include paths:
system include: C:\msys64\ucrt64\include\c++\15.2.0
system include: C:\msys64\ucrt64\include\c++\15.2.0\x86_64-w64-mingw32
system include: C:\msys64\ucrt64\include\c++\15.2.0\backward
system include: C:\msys64\ucrt64\lib\gcc\x86_64-w64-mingw32\15.2.0\include
system include: C:\msys64\ucrt64\include
system include: C:\msys64\ucrt64\lib\gcc\x86_64-w64-mingw32\15.2.0\include-fixed
Defines:
_DEBUG
UNICODE
_UNICODE
Standard Version: c++23
IntelliSense Mode: windows-gcc-x64
Other Flags:
--g++
--gnu_version=150200
Total Memory Usage: 198 MB
------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 4201
Other Extensions
Issue occurs on a fresh VS Code installation with only the ms-vscode.cpptools extension installed. No other extensions are active.
Additional context
Command-line compilation using a batch file with the same compiler and flags works perfectly and shows the warnings when an error is introduced. This confirms the compiler toolchain is functional.
The issue is isolated to the IntelliSense service not respecting the compilerArgs.
The diagnostic log shows that the configuration file is being read correctly, the compiler is found, and the C++ standard is set, but the compilerArgs appear to be ignored by the IntelliSense process.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status