microsoft / microsoft/vscode-cpptools

Decimal use produces unexpected errors: "identifier "_Decimal128" is undefined"; "extra text after expected end of number"

Open
#11,939 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Language Service Visual Studio
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Environment
  • OS and Version: Windows 11 Pro (10.0.22621)
  • VS Code Version: 1.86
  • C/C++ Extension Version: 1.18.5
  • If using SSH remote, specify OS of remote machine: Rocky Linux 9.3 x64
Bug Summary and Steps to Reproduce

Bug Summary:
C/C++ is reporting errors in a source project that uses GCC's _Decimal128 implementation.

Steps to reproduce:

Create new project containing single file on remote

int main (int argc, char **argv) {
  _Decimal128 v;
  v=1.25DL;
  return (int)v;
}

Result is two errors for the source file:

identifier "_Decimal128" is undefined
extra text after expected end of number

Expected behavior:

No errors

Configuration and Logs
c_cpp_properties.json
{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "c23",
            "cppStandard": "c++23",
            "intelliSenseMode": "linux-gcc-x64"
        }
    ],
    "version": 4
}

C/C++: Log Diagnostics output:

-------- Diagnostics - 08/02/2024, 14:08:12
Version: 1.18.5
Current Configuration:
{
    "name": "Linux",
    "includePath": [
        "/tmp/dectest/**"
    ],
    "defines": [],
    "compilerPath": "/usr/bin/gcc",
    "cStandard": "c23",
    "cppStandard": "c++23",
    "intelliSenseMode": "linux-gcc-x64",
    "compilerPathIsExplicit": true,
    "cStandardIsExplicit": true,
    "cppStandardIsExplicit": true,
    "intelliSenseModeIsExplicit": true,
    "compilerPathInCppPropertiesJson": "/usr/bin/gcc",
    "mergeConfigurations": false,
    "browse": {
        "path": [
            "/tmp/dectest/**",
            "${workspaceFolder}"
        ],
        "limitSymbolsToIncludedHeaders": true
    }
}
cpptools version (native): 1.18.3.0
Translation Unit Mappings:
[ /tmp/dectest/dectest.c ]:
    /tmp/dectest/dectest.c
Translation Unit Configurations:
[ /tmp/dectest/dectest.c ]:
    Process ID: 491636
    Memory Usage: 10 MB
    Compiler Path: /usr/bin/gcc
    Includes:
        /usr/lib/gcc/x86_64-redhat-linux/11/include
        /usr/local/include
        /usr/include
    Standard Version: c23
    IntelliSense Mode: linux-gcc-x64
    Other Flags:
        --gcc
        --gnu_version=110401
Total Memory Usage: 10 MB

------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 6377



Language Server Debug Logging:

loggingLevel: Debug
loggingLevel has changed to: Debug
LSP: (invoked) cpptools/didChangeCppProperties (id: 172)
LSP: (received) cpptools/getCodeActions: file:///tmp/dectest/dectest.c (id: 173)
LSP: (received) cpptools/activeDocumentChange: file:///tmp/dectest/dectest.c
LSP: (invoked) cpptools/getCodeActions: file:///tmp/dectest/dectest.c (id: 173)
LSP: (received) cpptools/textEditorSelectionChange
LSP: (invoked) cpptools/activeDocumentChange: file:///tmp/dectest/dectest.c
LSP: (invoked) cpptools/textEditorSelectionChange
LSP: (received) cpptools/getInlayHints: file:///tmp/dectest/dectest.c (id: 174)
LSP: (invoked) cpptools/getInlayHints: file:///tmp/dectest/dectest.c (id: 174)
LSP: (received) cpptools/getCodeActions: file:///tmp/dectest/dectest.c (id: 175)
LSP: (invoked) cpptools/getCodeActions: file:///tmp/dectest/dectest.c (id: 175)
LSP: (received) cpptools/getFoldingRanges: file:///tmp/dectest/dectest.c (id: 176)
LSP: (invoked) cpptools/getFoldingRanges: file:///tmp/dectest/dectest.c (id: 176)
LSP: (received) cpptools/getSemanticTokens: file:///tmp/dectest/dectest.c (id: 177)
LSP: (invoked) cpptools/getSemanticTokens: file:///tmp/dectest/dectest.c (id: 177)
LSP: (received) cpptools/activeDocumentChange: file:///tmp/dectest/dectest.c
LSP: (invoked) cpptools/activeDocumentChange: file:///tmp/dectest/dectest.c
LSP: (received) cpptools/textEditorSelectionChange
LSP: (invoked) cpptools/textEditorSelectionChange
LSP: (received) cpptools/getCodeActions: file:///tmp/dectest/dectest.c (id: 178)
LSP: (invoked) cpptools/getCodeActions: file:///tmp/dectest/dectest.c (id: 178)
LSP: (received) cpptools/getCodeActions: file:///tmp/dectest/dectest.c (id: 179)
LSP: (invoked) cpptools/getCodeActions: file:///tmp/dectest/dectest.c (id: 179)
LSP: (received) cpptools/activeDocumentChange: file:///tmp/dectest/dectest.c
LSP: (invoked) cpptools/activeDocumentChange: file:///tmp/dectest/dectest.c
LSP: (received) cpptools/textEditorSelectionChange
LSP: (received) cpptools/textEditorSelectionChange
LSP: (invoked) cpptools/textEditorSelectionChange
LSP: (invoked) cpptools/textEditorSelectionChange
LSP: (received) textDocument/hover: file:///tmp/dectest/dectest.c (id: 180)
LSP: (invoked) textDocument/hover: file:///tmp/dectest/dectest.c (id: 180)
LSP: (received) cpptools/getCodeActions: file:///tmp/dectest/dectest.c (id: 181)
LSP: (invoked) cpptools/getCodeActions: file:///tmp/dectest/dectest.c (id: 181)
LSP: (received) textDocument/documentHighlight: file:///tmp/dectest/dectest.c (id: 182)
LSP: (invoked) textDocument/documentHighlight: file:///tmp/dectest/dectest.c (id: 182)
LSP: (received) cpptools/textEditorSelectionChange
LSP: (invoked) cpptools/textEditorSelectionChange
LSP: (received) cpptools/getCodeActions: file:///tmp/dectest/dectest.c (id: 183)
LSP: (invoked) cpptools/getCodeActions: file:///tmp/dectest/dectest.c (id: 183)
LSP: (received) textDocument/didChange: file:///tmp/dectest/dectest.c
LSP: (invoked) textDocument/didChange: file:///tmp/dectest/dectest.c
LSP: (received) cpptools/textEditorSelectionChange
LSP: (invoked) cpptools/textEditorSelectionChange
LSP: (received) cpptools/getCodeActions: file:///tmp/dectest/dectest.c (id: 184)
LSP: (invoked) cpptools/getCodeActions: file:///tmp/dectest/dectest.c (id: 184)
LSP: (received) cpptools/getFoldingRanges: file:///tmp/dectest/dectest.c (id: 185)
LSP: (invoked) cpptools/getFoldingRanges: file:///tmp/dectest/dectest.c (id: 185)
LSP: (received) cpptools/getSemanticTokens: file:///tmp/dectest/dectest.c (id: 186)
LSP: (invoked) cpptools/getSemanticTokens: file:///tmp/dectest/dectest.c (id: 186)
LSP: (received) cpptools/getDocumentSymbols: file:///tmp/dectest/dectest.c (id: 187)
LSP: (invoked) cpptools/getDocumentSymbols: file:///tmp/dectest/dectest.c (id: 187)
  tag parsing file: /tmp/dectest/dectest.c
LSP: (received) textDocument/hover: file:///tmp/dectest/dectest.c (id: 188)
LSP: (invoked) textDocument/hover: file:///tmp/dectest/dectest.c (id: 188)
sending 1 changes to server
LSP: (received) textDocument/documentHighlight: file:///tmp/dectest/dectest.c (id: 189)
LSP: (invoked) textDocument/documentHighlight: file:///tmp/dectest/dectest.c (id: 189)
LSP: (received) cpptools/textEditorSelectionChange
LSP: (invoked) cpptools/textEditorSelectionChange
LSP: (received) cpptools/getCodeActions: file:///tmp/dectest/dectest.c (id: 190)
LSP: (invoked) cpptools/getCodeActions: file:///tmp/dectest/dectest.c (id: 190)
LSP: (received) textDocument/didChange: file:///tmp/dectest/dectest.c
LSP: (invoked) textDocument/didChange: file:///tmp/dectest/dectest.c
LSP: (received) cpptools/textEditorSelectionChange
LSP: (invoked) cpptools/textEditorSelectionChange
LSP: (received) cpptools/getCodeActions: file:///tmp/dectest/dectest.c (id: 191)
LSP: (invoked) cpptools/getCodeActions: file:///tmp/dectest/dectest.c (id: 191)
LSP: (received) cpptools/getFoldingRanges: file:///tmp/dectest/dectest.c (id: 192)
LSP: (invoked) cpptools/getFoldingRanges: file:///tmp/dectest/dectest.c (id: 192)
LSP: (received) textDocument/hover: file:///tmp/dectest/dectest.c (id: 193)
LSP: (invoked) textDocument/hover: file:///tmp/dectest/dectest.c (id: 193)
sending 1 changes to server
LSP: (received) textDocument/documentHighlight: file:///tmp/dectest/dectest.c (id: 194)
LSP: (invoked) textDocument/documentHighlight: file:///tmp/dectest/dectest.c (id: 194)
LSP: (received) cpptools/textEditorSelectionChange
LSP: (invoked) cpptools/textEditorSelectionChange
LSP: (received) cpptools/getDocumentSymbols: file:///tmp/dectest/dectest.c (id: 195)
LSP: (invoked) cpptools/getDocumentSymbols: file:///tmp/dectest/dectest.c (id: 195)
  tag parsing file: /tmp/dectest/dectest.c
idle loop: reparsing the active document
Checking for syntax errors: /tmp/dectest/dectest.c
Queueing IntelliSense update for files in translation unit of: /tmp/dectest/dectest.c
LSP: (received) cpptools/getCodeActions: file:///tmp/dectest/dectest.c (id: 196)
LSP: (invoked) cpptools/getCodeActions: file:///tmp/dectest/dectest.c (id: 196)
LSP: (received) textDocument/didChange: file:///tmp/dectest/dectest.c
LSP: (invoked) textDocument/didChange: file:///tmp/dectest/dectest.c
LSP: (received) cpptools/textEditorSelectionChange
LSP: (invoked) cpptools/textEditorSelectionChange
sending 1 changes to server
Error squiggle count: 2
LSP: Request canceled by server (cpptools/getSemanticTokens, code: -32802, id: 186)
Update IntelliSense time (sec): 0.258
LSP: (received) cpptools/getCodeActions: file:///tmp/dectest/dectest.c (id: 197)
LSP: (invoked) cpptools/getCodeActions: file:///tmp/dectest/dectest.c (id: 197)
LSP: (received) cpptools/getFoldingRanges: file:///tmp/dectest/dectest.c (id: 198)
LSP: (invoked) cpptools/getFoldingRanges: file:///tmp/dectest/dectest.c (id: 198)
LSP: (received) cpptools/getSemanticTokens: file:///tmp/dectest/dectest.c (id: 199)
LSP: (invoked) cpptools/getSemanticTokens: file:///tmp/dectest/dectest.c (id: 199)
LSP: (received) cpptools/getDocumentSymbols: file:///tmp/dectest/dectest.c (id: 200)
LSP: (invoked) cpptools/getDocumentSymbols: file:///tmp/dectest/dectest.c (id: 200)
  tag parsing file: /tmp/dectest/dectest.c
LSP: (received) cpptools/getInlayHints: file:///tmp/dectest/dectest.c (id: 201)
LSP: (invoked) cpptools/getInlayHints: file:///tmp/dectest/dectest.c (id: 201)
LSP: (received) textDocument/willSaveWaitUntil: file:///tmp/dectest/dectest.c (id: 202)
LSP: (invoked) textDocument/willSaveWaitUntil: file:///tmp/dectest/dectest.c (id: 202)
willSaveWaitUntil: 0ms
LSP: (received) textDocument/didSave: file:///tmp/dectest/dectest.c
LSP: (invoked) textDocument/didSave: file:///tmp/dectest/dectest.c
  tag parsing file: /tmp/dectest/dectest.c
LSP: (received) cpptools/fileChanged: file:///tmp/dectest/dectest.c
LSP: (invoked) cpptools/fileChanged: file:///tmp/dectest/dectest.c
idle loop: reparsing the active document
Checking for syntax errors: /tmp/dectest/dectest.c
Queueing IntelliSense update for files in translation unit of: /tmp/dectest/dectest.c
Checking for syntax errors: /tmp/dectest/dectest.c
Queueing IntelliSense update for files in translation unit of: /tmp/dectest/dectest.c
Error squiggle count: 2
Update IntelliSense time (sec): 0.509
LSP: (received) cpptools/getSemanticTokens: file:///tmp/dectest/dectest.c (id: 203)
LSP: (invoked) cpptools/getSemanticTokens: file:///tmp/dectest/dectest.c (id: 203)
LSP: (received) cpptools/getInlayHints: file:///tmp/dectest/dectest.c (id: 204)
LSP: (invoked) cpptools/getInlayHints: file:///tmp/dectest/dectest.c (id: 204)
LSP: (received) cpptools/getCodeActions: file:///tmp/dectest/dectest.c (id: 205)
LSP: (invoked) cpptools/getCodeActions: file:///tmp/dectest/dectest.c (id: 205)
LSP: (received) cpptools/getFoldingRanges: file:///tmp/dectest/dectest.c (id: 206)
LSP: (invoked) cpptools/getFoldingRanges: file:///tmp/dectest/dectest.c (id: 206)
Other Extensions

Only extensions enabled for the workspace are the remote developent extensions.

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the single-file reproducer at /tmp/dectest/dectest.c and the logged C/C++ configuration using GCC, C23, and linux-gcc-x64. Reproduce the two diagnostics, then trace the IntelliSense parsing path for _Decimal128 and the 1.25DL literal. Done means both diagnostics are absent for the supplied C source.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, typescript, vscode
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.