Closed
Description
Type: LanguageService
Describe the bug
- OS and Version:Linux4.15.0
- VS Code Version:1.45.1
5763d909d5f12fe19f215cbfdd29a91c0fa9208a
x64 - C/C++ Extension Version:0.28.1
- Other extensions you installed (and if the issue persists after disabling them):None
- Does this issue involve using SSH remote to run the extension on a remote machine?:No
- A clear and concise description of what the bug is, including information about the workspace (i.e. is the workspace a single project or multiple projects, size of the project, etc).
I think this is a IntelliSense error. I am trying to write a simple linux kernel module project, and vscode prompt me: 1. the semicolon is missing. 2. could not find macro __exit(but the macro __init is successfully found, which is in the same file with __exit)
Steps to reproduce
- This is my code hallo.c
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Fasion Chan");
MODULE_DESCRIPTION("An hello worlk module for demonstration");
MODULE_VERSION("1.0");
static int __init hello_init(void)
{
printk(KERN_INFO "HELLO: Hello, this is hello module speaking\n");
return 0;
}
static void __exit hello_exit(void)
{
printk(KERN_INFO "HELLO: Goodbye");
}
module_init(hello_init);
module_exit(hello_exit);
- This is my c_cpp_properties.json
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/usr/src/linux-4.15/include/",
"/usr/src/linux-4.15/arch/x86/include/"
],
"defines": [
"_GNU_SOURCE"
],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "gcc-x64"
}
],
"version": 4
}
- See error
Expected behavior
Obviously the program is no problem, because it can be compiled and loaded correctly. So i think it is IntelliSense‘ bug.
Logs
-------- Diagnostics - 2020/5/31 下午4:18:22
Version: 0.28.1
Current Configuration:
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/usr/src/linux-4.15/include/",
"/usr/src/linux-4.15/arch/x86/include/"
],
"defines": [
"_GNU_SOURCE"
],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "gcc-x64",
"compilerArgs": [],
"browse": {
"path": [
"${workspaceFolder}/**",
"/usr/src/linux-4.15/include/",
"/usr/src/linux-4.15/arch/x86/include/"
],
"limitSymbolsToIncludedHeaders": true
}
}
Translation Unit Mappings:
[ /home/nano/Code/softwarebei/test_module/hello.c ]:
/home/nano/Code/softwarebei/test_module/hello.c
Translation Unit Configurations:
[ /home/nano/Code/softwarebei/test_module/hello.c ]:
Process ID: 14224
Memory Usage: 39 MB
Compiler Path: /usr/bin/gcc
Includes:
/usr/src/linux-4.15/include
/usr/src/linux-4.15/arch/x86/include
/usr/lib/gcc/x86_64-linux-gnu/6/include
/usr/local/include
/usr/lib/gcc/x86_64-linux-gnu/6/include-fixed
/usr/include/x86_64-linux-gnu
/usr/include
Defines:
_GNU_SOURCE
Standard Version: c11
IntelliSense Mode: gcc-x64
Other Flags:
--gcc
--gnu_version=60300
Total Memory Usage: 39 MB
Screenshots
Additional context