-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
Bug type: Language Service
Describe the bug
- OS and Version: Windows 10 x64 1909
- VS Code Version: 1.58.2
- C/C++ Extension Version: 1.5.1
- Other extensions you installed (and if the issue persists after disabling them): C++ Intellisense (still persists without it)
extern "C" blocks are ok, but using it like this:
extern "C" void doSomething();causes an error. However, this does not always happen, especially after compiling using a Makefile.
Steps to reproduce
- Create a C++ header file.
- Create an extern "C" function, such as the one shown above.
Expected behavior
This is valid C++, so it should not be treated as an error.
Code sample and logs
-
Code sample
- See the code above or the screenshot.
-
Configurations in
c_cpp_properties.json- I do not have this.
-
Logs from running
C/C++: Log Diagnosticsfrom the VS Code command palette
-------- Diagnostics - 20/07/2021, 12:15:58
Version: 1.5.1
Current Configuration:
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.19041.0",
"cStandard": "c17",
"cppStandard": "c++17",
"compilerArgs": [],
"intelliSenseMode": "windows-gcc-x64",
"intelliSenseModeIsExplicit": true,
"cStandardIsExplicit": false,
"cppStandardIsExplicit": false,
"compilerPathIsExplicit": true,
"compilerPath": "g++",
"browse": {
"path": [
"${workspaceFolder}/**"
],
"limitSymbolsToIncludedHeaders": true
}
}
Translation Unit Mappings:
[ C:\Users\####\Programming\C++\OpenGL\Tutorial\src\main.c ]:
C:\USERS\####\PROGRAMMING\C++\OPENGL\TUTORIAL\SRC\MAIN.C
C:\USERS\####\PROGRAMMING\C++\OPENGL\TUTORIAL\INCLUDE\CONST.H
Translation Unit Configurations:
[ C:\Users\####\Programming\C++\OpenGL\Tutorial\src\main.c ]:
Process ID: 14200
Memory Usage: 13 MB
Compiler Path: C:\msys64\mingw64\bin\g++.exe
Includes:
C:\MSYS64\MINGW64\LIB\GCC\X86_64-W64-MINGW32\10.2.0\INCLUDE
C:\MSYS64\MINGW64\INCLUDE
C:\MSYS64\MINGW64\LIB\GCC\X86_64-W64-MINGW32\10.2.0\INCLUDE-FIXED
C:\MSYS64\MINGW64\X86_64-W64-MINGW32\INCLUDE
C:\USERS\####\PROGRAMMING\C++\OPENGL\TUTORIAL\INCLUDE
Defines:
_DEBUG
UNICODE
_UNICODE
Standard Version: c17
IntelliSense Mode: windows-gcc-x64
Other Flags:
--gcc
--gnu_version=100200
Total Memory Usage: 13 MB
------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 3839
- Logs from the language server logging
- TL;DR: It says nothing about extern "C".
Screenshots
Additional context
None
Metadata
Metadata
Assignees
Labels
No labels
