Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

identifier "size_t" is undefined (g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0) #12990

Open
GuigzLab opened this issue Nov 22, 2024 · 1 comment
Assignees
Labels
Language Service more info needed The issue report is not actionable in its current state parser regression A bug that didn't exist in a previous release

Comments

@GuigzLab
Copy link

Environment

  • OS and Version: Ubuntu 22.04 (using WSL2 on Windows 11)
  • VS Code Version: 1.95.3
  • C/C++ Extension Version: v1.22.11 (also tried the pre-release version)

Bug Summary and Steps to Reproduce

Hi, I recently started to experience an issue using vscode IntelliSense, size_t :
identifier "size_t" is undefined C/C++(20)

I'm compiling fine though.

I'm using vscode in a docker using the Dev Containers extension.

I tried adding this part from this issue but nothing changed:

    "C_Cpp.default.defines": [
        "__building_module(x)=0"
    ],

Depending on the files I'm working on, I either get identifier "size_t" is undefined or It's linked to a redefinition of size_t from different modules (gdal, curl...)

Configuration and Logs

Here is my configuration on the remote host:

{
    "C_Cpp.default.includePath": [
        "${default}",
        "${workspaceFolder}/**",
    ],
    // Folders to exclude from workspace parsing    
    "C_Cpp.files.exclude": {
        "**/build/**": true,
        "/home/builder/workspace/data/**": true,
    },
    // Files changes to exclude    
    "files.watcherExclude": {
        "**/build/**": true,
        "/home/builder/workspace/data/**": true,
    },
    // Files search to exclude    
    "search.exclude": {
        "**/build/**": true,
        "/home/builder/workspace/data/**": true,
    },
    "C_Cpp.default.intelliSenseMode": "linux-gcc-x64",
    "C_Cpp.default.cppStandard": "c++17",
    "C_Cpp.default.cStandard": "c17",
    "C_Cpp.default.compilerPath": "/usr/bin/g++",
    "C_Cpp.default.defines": [
        "__building_module(x)=0"
    ],
}

Other Extensions

Dev Containers

Additional context

No response

@sean-mcmanus
Copy link
Contributor

@GuigzLab What version of g++? Can you confirm that it doesn't repro with 1.21.6? What is the minimal repro code? Does it repro with

#include <cstddef>

size_t i;

If you use Go to Def on cstddef are you able to locate the first file that shows an error? And/or use Go to Def on size_t. That could help locate the source of issue the issue that is causing the definition of size_t to not be parsed.

@sean-mcmanus sean-mcmanus self-assigned this Nov 22, 2024
@sean-mcmanus sean-mcmanus added Language Service more info needed The issue report is not actionable in its current state parser regression A bug that didn't exist in a previous release labels Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Language Service more info needed The issue report is not actionable in its current state parser regression A bug that didn't exist in a previous release
Projects
Status: No status
Development

No branches or pull requests

2 participants