Skip to content

False positive on struct declaration #14839

Open

Description

@Caucaucybu

Environment

  • OS and Version: Pop!-os 26.04, kernel version : 7.2.6-76070206-generic
  • VS Code Version: 1.142.0
  • C/C++ Extension Version: 1.35.4

Bug Summary and Steps to Reproduce

Bug Summary:
When declaring a struct in C, I sometimes get the following false positive from IntelliSense:
this declaration of struct "test_s" does not declare the same type as the declaration at line 1 C/C++(3799)

Steps to reproduce:

  • Create a new .c file.

  • Paste the following code:

struct test_s {
    int x;
};
  • Observe the diagnostic on the struct declaration.

Expected behavior:
No error

Configuration and Logs

-------- Diagnostics - 20/10/2026 22:32:22
Version: 1.35.4
Current Configuration:
{
    "name": "Linux",
    "includePath": [
        "/home/fuco/Workflow/test/**"
    ],
    "defines": [],
    "compilerPath": "/usr/bin/gcc",
    "cStandard": "gnu23",
    "cppStandard": "gnu++17",
    "intelliSenseMode": "linux-gcc-x64",
    "compilerPathInCppPropertiesJson": "/usr/bin/gcc",
    "intelliSenseModeIsExplicit": false,
    "cStandardIsExplicit": false,
    "cppStandardIsExplicit": false,
    "mergeConfigurations": false,
    "recursiveIncludes": {},
    "recursiveIncludesPriorityIsExplicit": false,
    "recursiveIncludesOrderIsExplicit": false,
    "compilerPathIsExplicit": false,
    "browse": {
        "limitSymbolsToIncludedHeaders": true
    }
}
Modified Settings:
{
    "C_Cpp.vcFormat.newLine.beforeOpenBrace.function": "sameLine",
    "C_Cpp.vcFormat.newLine.beforeOpenBrace.block": "sameLine",
    "C_Cpp.vcFormat.newLine.beforeOpenBrace.lambda": "sameLine",
    "C_Cpp.vcFormat.newLine.closeBraceSameLine.emptyType": true,
    "C_Cpp.vcFormat.space.insertAfterSemicolon": true
}
Additional Tracked Settings:
{
    "editorTabSize": 4,
    "editorInsertSpaces": true,
    "editorAutoClosingBrackets": "languageDefined",
    "filesEncoding": "utf8",
    "filesAssociations": {},
    "filesExclude": {
        "**/.git": true,
        "**/.svn": true,
        "**/.hg": true,
        "**/.jj": true,
        "**/.DS_Store": true,
        "**/Thumbs.db": true
    },
    "filesAutoSaveAfterDelay": true,
    "editorInlayHintsEnabled": true,
    "editorParameterHintsEnabled": true,
    "searchExclude": {
        "**/node_modules": true,
        "**/bower_components": true,
        "**/*.code-search": true
    },
    "workbenchSettingsEditor": "ui"
}
cpptools version (native): 1.35.4.0
Current database path: /home/fuco/.cache/vscode-cpptools/e1ff282c2a110311f8747a3c5f985f5e/.browse.VC.db
Translation Unit Mappings:
[ /home/fuco/Workflow/test/test.c - source TU]:
Translation Unit Configurations:
[ /home/fuco/Workflow/test/test.c ]
    Process ID: 19327
    Memory Usage: 20 MB
    Compiler Path: /usr/bin/gcc
    Language: C
    Include Paths:
        system include: /usr/lib/gcc/x86_64-linux-gnu/15/include
        system include: /usr/local/include
        system include: /usr/include/x86_64-linux-gnu
        system include: /usr/include
        include (recursive): /home/fuco/Workflow/test
    Standard Version: c23
    IntelliSense Mode: linux-gcc-x64
    Other Flags:
        --gcc
        --gnu_version=150200
Total Memory Usage: 20 MB

Other Extensions

No response

Additional context

No response

Activity

  1. changed the title [-]False positive on struct declaration (error[/-] [+]False positive on struct declaration[/+] on Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions