vscode-cpptools
vscode-cpptools copied to clipboard
IntelliSense partially incomplete for sigaction
Environment
- OS and Version: Windows 11
- VS Code Version: Version: 1.100.2
- C/C++ Extension Version: Version 1.25.3: April 28, 2025
- If using SSH remote, specify OS of remote machine:
Hello, I've found a weird behaviour of the intellisense and I'm wondering if it's normal. I'm learning about signals and while trying using sigaction the intellisense doesn't show the complete list of parameters.
Here's the code:
void handler(int signo, siginfo_t *info, void *empty) { printf("received SIGUSR2 %d", info->si_value.sival_int); }
If I try to interact with 'info->' si_value is missing and also susequent variables. The program compiles just fine.
Is this reproducible for you? Also note that I've tried fixing this with no avail at the moment, any help is appreciated.
I hope this is the right place. if this is an issue not related to VS Code I apologize, do not hesitate to tell me.
Bug Summary and Steps to Reproduce
Bug Summary: About <signal.h>, siginfo_t, Intellisense doesn't show all fields of struct
Steps to reproduce:
- include <signal.h>
- create a custom handler void handler_giocatori(int signo, siginfo_t *info, void *empty){}
- try to access siginfo_t varibale (in this case info->)
Expected behavior: Intellisense should show all expected fields
Configuration and Logs
Here's my c_cpp_properties,json file:
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/usr/include",
"/usr/include/x86_64-linux-gnu"
],
"defines": [
"_GNU_SOURCE",
"_POSIX_C_SOURCE=200809L"
],
"compilerPath": "/usr/bin/gcc",
"intelliSenseMode": "linux-gcc-x64",
"cStandard": "gnu23",
"cppStandard": "gnu++23"
}
],
"version": 4
}
Here's the output of 'C/C++: log diagnostics':
-------- Diagnostics - 5/28/2025, 3:04:59 PM
Version: 1.25.3
Current Configuration:
{
"name": "Linux",
"includePath": [
"/home/francesco/University/Sistemi Operativi/Sistemi Operativi 2024-2025/**",
"/usr/include",
"/usr/include/x86_64-linux-gnu"
],
"defines": [
"_GNU_SOURCE",
"_POSIX_C_SOURCE=200809L"
],
"compilerPath": "/usr/bin/gcc",
"intelliSenseMode": "linux-gcc-x64",
"cStandard": "gnu23",
"cppStandard": "gnu++23",
"compilerPathIsExplicit": true,
"cStandardIsExplicit": true,
"cppStandardIsExplicit": true,
"intelliSenseModeIsExplicit": true,
"recursiveIncludesReduceIsExplicit": false,
"recursiveIncludesPriorityIsExplicit": false,
"recursiveIncludesOrderIsExplicit": false,
"compilerPathInCppPropertiesJson": "/usr/bin/gcc",
"mergeConfigurations": false,
"recursiveIncludes": {},
"browse": {
"limitSymbolsToIncludedHeaders": true
}
}
Modified Settings:
{
"C_Cpp.default.cStandard": "gnu23",
"C_Cpp.default.cppStandard": "gnu++23"
}
Additional Tracked Settings:
{
"editorTabSize": 2,
"editorInsertSpaces": true,
"editorAutoClosingBrackets": "languageDefined",
"filesEncoding": "utf8",
"filesAssociations": {
"stdio.h": "c",
"string.h": "c",
"stdlib.h": "c",
"signal.h": "c",
"types.h": "c"
},
"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.25.3.0
Current database path: /home/francesco/.cache/vscode-cpptools/57f27239870de5782ca0427dd3ae631f/.browse.VC.db
Translation Unit Mappings:
[ /home/francesco/University/Sistemi Operativi/Sistemi Operativi 2024-2025/Esami/simulazione_LabSO_26052025/simulazione_LabSO_26052025.c - source TU]:
/usr/include/asm-generic/errno-base.h
/usr/include/errno.h
/usr/include/math.h
/usr/include/signal.h
/usr/include/stdio.h
/usr/include/stdlib.h
/usr/include/string.h
/usr/include/strings.h
/usr/include/time.h
/usr/include/unistd.h
/usr/include/x86_64-linux-gnu/bits/confname.h
/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h
/usr/include/x86_64-linux-gnu/bits/mathcalls-narrow.h
/usr/include/x86_64-linux-gnu/bits/sigaction.h
/usr/include/x86_64-linux-gnu/bits/signum-generic.h
/usr/include/x86_64-linux-gnu/bits/stat.h
/usr/include/x86_64-linux-gnu/bits/timex.h
/usr/include/x86_64-linux-gnu/bits/types/FILE.h
/usr/include/x86_64-linux-gnu/bits/types/error_t.h
/usr/include/x86_64-linux-gnu/bits/types/sig_atomic_t.h
/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h
/usr/include/x86_64-linux-gnu/sys/stat.h
/usr/include/x86_64-linux-gnu/sys/types.h
/usr/include/x86_64-linux-gnu/sys/wait.h
/usr/lib/gcc/x86_64-linux-gnu/9/include/stddef.h
Translation Unit Configurations:
[ /home/francesco/University/Sistemi Operativi/Sistemi Operativi 2024-2025/Esami/simulazione_LabSO_26052025/simulazione_LabSO_26052025.c ]
Process ID: 25929
Memory Usage: 29 MB
Compiler Path: /usr/bin/gcc
Include paths:
include: /usr/include
include: /usr/include/x86_64-linux-gnu
system include: /usr/lib/gcc/x86_64-linux-gnu/9/include
system include: /usr/local/include
system include: /usr/include/x86_64-linux-gnu
system include: /usr/include
Defines:
_GNU_SOURCE
_POSIX_C_SOURCE=200809L
Standard Version: c23
IntelliSense Mode: linux-gcc-x64
Other Flags:
--gcc
--gnu_version=90400
Total Memory Usage: 29 MB
------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 2710
Other Extensions
No response
Additional context
No response
@francescounitn It's working for me
It looks like you need to remove
"/usr/include",
"/usr/include/x86_64-linux-gnu"
from your include path. That will likely break the system include path order (plus their not being treated properly as system include paths).
@francescounitn It's working for me
It looks like you need to remove
"/usr/include", "/usr/include/x86_64-linux-gnu"from your include path. That will likely break the system include path order (plus their not being treated properly as system include paths).
@sean-mcmanus Thank you for your answer. Even tough I added them to try and fix this this issue I followed your suggestion but it still didn't work.
I do not understand why this happens. Tell me if you have any more ideas.
@francescounitn Can you provide an updated C/C++: Log Diagnostics logging with the system includes removed?
Had a similar issue. IntelliSense struggles with #define fields.
@francescounitn It's working for me
It looks like you need to remove
"/usr/include", "/usr/include/x86_64-linux-gnu"from your include path. That will likely break the system include path order (plus their not being treated properly as system include paths).
First, this screenshot shows many fields missing anyway; siginfo has more than 20 fields..
Second, the same happens while trying to access the fields of a struct sigaction. The fields displayed by IntelliSense misses some of the fields defined through preprocessor macros:
Here's the definition of struct sigaction, found through "Go to Definition" (and thereby understood by IntelliSense).
Although this behavior is undesired, I'm not sure how much of it can be called a "bug" or how the tool can be improved to understand preprocessor macros.
@LeventCelik Yeah, our implementation doesn't include macros that could be used, i.e. I see
so in that case our IntelliSense completion doesn't handle the macro si_overrun and only understands _sifields._timer.si_overrun.
I've marked it as a feature request.
But FYI, the GitHub Copilot completions are able to complete it, but the completion behavior is not predictable:
This feature request is being closed due to insufficient upvotes. Please leave a 👍-upvote or 👎-downvote reaction on the issue to help us prioritize it. When enough upvotes are received, this issue will be eligible for our backlog.