Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

IntelliSense error: `First parameter of allocation function must be of type 'size_t'`

未关闭
#14,117 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
cpp
领域
devtools

调研方向

使用报告的 i686-elf-g++ 配置和 -m32 编译器参数,复现 archs/i686/kernel/src/memory/vmm.cpp 中的诊断。先阅读相关 issue #2460 和 #4506,然后验证在提供的 32 位设置下分配函数警告已得到解决,且没有引入新的诊断。

由索引模型根据 Issue 内容生成。

描述

bug Feature: Configuration Language Service parser
Environment
  • OS and Version: Win10 22H2 19045.6466
  • VS Code Version: 1.107.1
  • C/C++ Extension Version: 1.29.3
  • If using SSH remote, specify OS of remote machine: Kali Linux 2025.4 x86_64
Bug Summary and Steps to Reproduce

Bug Summary: Basically #2460 and #4506. It wasnt fixed. At least, not for x86 (32bit).
The workaround that was supposed to work was adding -m32 to the compiler args. Sadly, that didnt do anything.

Current code in which the intellisense errors:

void* operator new(std::size_t size) {
    return Memory::VMM::g_allocator.Allocate(size);
}
void* operator new[](std::size_t size) {
    return Memory::VMM::g_allocator.Allocate(size);
}

I also tried using size_t instead of std::size_t, but its the same thing; nothing changed.

Configuration and Logs

c_cpp_properties.json:

{
    "configurations": [
        {
            "name": "OSDev",
            "includePath": [
                "/opt/cross/**",
                "${workspaceFolder}/*",
                "${workspaceFolder}/**/**",
                "${workspaceFolder}/archs/**/kernel/include"
            ],
            "defines": [
                "__MULTIBOOT__",
                "_DEBUG"
            ],
            "compilerPath": "/opt/cross/bin/i686-elf-g++",
            "intelliSenseMode": "linux-gcc-x86",
            "compilerArgs": [
                "-fno-exceptions",
                "-fno-rtti",
                "-std=c++2c",
                "-ffreestanding",
                "-nostdlib",
                "-nostartfiles",
                "-nodefaultlibs",
                "-mno-red-zone",
                "-m32"
            ],
            "cStandard": "c23",
            "cppStandard": "c++23"
        }
    ],
    "version": 4
}

C/C++ Diagnostics:

-------- Diagnostics - 12/24/2025, 4:04:03 PM
Version: 1.29.3
Current Configuration:
{
    "name": "OSDev",
    "includePath": [
        "/opt/cross/**",
        "/home/tracer/OSDev/*",
        "/home/tracer/OSDev/archs/**",
        "/home/tracer/OSDev/config/**",
        "/home/tracer/OSDev/fonts/**",
        "/home/tracer/OSDev/isodir/**",
        "/home/tracer/OSDev/logs/**",
        "/home/tracer/OSDev/scripts/**",
        "/home/tracer/OSDev/archs/i686/**",
        "/home/tracer/OSDev/config/grub/**",
        "/home/tracer/OSDev/isodir/i686/**",
        "/home/tracer/OSDev/archs/i686/bootloader/**",
        "/home/tracer/OSDev/archs/i686/build/**",
        "/home/tracer/OSDev/archs/i686/kernel/**",
        "/home/tracer/OSDev/isodir/i686/boot/**",
        "/home/tracer/OSDev/archs/i686/bootloader/out/**",
        "/home/tracer/OSDev/archs/i686/bootloader/src/**",
        "/home/tracer/OSDev/archs/i686/kernel/include/**",
        "/home/tracer/OSDev/archs/i686/kernel/out/**",
        "/home/tracer/OSDev/archs/i686/kernel/src/**",
        "/home/tracer/OSDev/isodir/i686/boot/grub/**",
        "/home/tracer/OSDev/archs/i686/kernel/out/descriptors/**",
        "/home/tracer/OSDev/archs/i686/kernel/out/klibc/**",
        "/home/tracer/OSDev/archs/i686/kernel/out/memory/**",
        "/home/tracer/OSDev/archs/i686/kernel/include/descriptors/**",
        "/home/tracer/OSDev/archs/i686/kernel/include/grub/**",
        "/home/tracer/OSDev/archs/i686/kernel/include/harddisk/**",
        "/home/tracer/OSDev/archs/i686/kernel/include/klibc/**",
        "/home/tracer/OSDev/archs/i686/kernel/include/memory/**",
        "/home/tracer/OSDev/archs/i686/kernel/include/video/**",
        "/home/tracer/OSDev/archs/i686/kernel/src/descriptors/**",
        "/home/tracer/OSDev/archs/i686/kernel/src/klibc/**",
        "/home/tracer/OSDev/archs/i686/kernel/src/memory/**",
        "/home/tracer/OSDev/archs/i686/kernel/include/harddisk/drivers/**",
        "/home/tracer/OSDev/archs/i686/kernel/include"
    ],
    "defines": [
        "__MULTIBOOT__",
        "_DEBUG"
    ],
    "compilerPath": "/opt/cross/bin/i686-elf-g++",
    "intelliSenseMode": "linux-gcc-x86",
    "compilerArgs": [
        "-fno-exceptions",
        "-fno-rtti",
        "-std=c++2c",
        "-ffreestanding",
        "-nostdlib",
        "-nostartfiles",
        "-nodefaultlibs",
        "-mno-red-zone",
        "-m32"
    ],
    "cStandard": "c23",
    "cppStandard": "c++23",
    "compilerPathIsExplicit": true,
    "cStandardIsExplicit": true,
    "cppStandardIsExplicit": true,
    "intelliSenseModeIsExplicit": true,
    "recursiveIncludesReduceIsExplicit": false,
    "recursiveIncludesPriorityIsExplicit": false,
    "recursiveIncludesOrderIsExplicit": false,
    "compilerPathInCppPropertiesJson": "/opt/cross/bin/i686-elf-g++",
    "mergeConfigurations": false,
    "recursiveIncludes": {},
    "browse": {
        "limitSymbolsToIncludedHeaders": true
    }
}
Modified Settings:
{
    "C_Cpp.default.intelliSenseMode": "gcc-x86",
    "C_Cpp.default.compilerPath": "/opt/cross/bin/i686-elf-g++",
    "C_Cpp.default.cStandard": "c23",
    "C_Cpp.default.cppStandard": "c++23",
    "C_Cpp.default.customConfigurationVariables": {},
    "C_Cpp.loggingLevel": "Debug"
}
Additional Tracked Settings:
{
    "editorTabSize": 4,
    "editorInsertSpaces": true,
    "editorAutoClosingBrackets": "languageDefined",
    "filesEncoding": "utf8",
    "filesAssociations": {
        "*.css": "tailwindcss"
    },
    "filesExclude": {
        "**/.git": true,
        "**/.svn": true,
        "**/.hg": true,
        "**/.DS_Store": true,
        "**/Thumbs.db": true
    },
    "filesAutoSaveAfterDelay": false,
    "editorInlayHintsEnabled": false,
    "editorParameterHintsEnabled": true,
    "searchExclude": {
        "**/node_modules": true,
        "**/bower_components": true,
        "**/*.code-search": true
    },
    "workbenchSettingsEditor": "ui"
}
cpptools version (native): 1.29.2.0
Current database path: /home/tracer/.cache/vscode-cpptools/957e046abb2e24884e6a191f8ce7f5c7/.browse.VC.db
Translation Unit Mappings:
[ /home/tracer/OSDev/archs/i686/kernel/src/memory/vmm.cpp - source TU]:
Translation Unit Configurations:
[ /home/tracer/OSDev/archs/i686/kernel/src/memory/vmm.cpp ]
    Process ID: 517
    Memory Usage: 33 MB
    Compiler Path: /opt/cross/bin/i686-elf-g++
    Include paths:
        include: /home/tracer/OSDev
        include: /home/tracer/OSDev/archs/i686/kernel/include
        system include: /opt/cross/i686-elf/include/c++/15.1.0
        system include: /opt/cross/i686-elf/include/c++/15.1.0/i686-elf
        system include: /opt/cross/i686-elf/include/c++/15.1.0/backward
        system include: /opt/cross/lib/gcc/i686-elf/15.1.0/include
        system include: /opt/cross/lib/gcc/i686-elf/15.1.0/include-fixed
        system include: /opt/cross/i686-elf/include
    Defines:
        __MULTIBOOT__
        _DEBUG
    Standard Version: c++26
    IntelliSense Mode: linux-gcc-x86
    Other Flags:
        --g++
        --gnu_version=150100
Total Memory Usage: 33 MB

------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 1329
Number of files parsed: 110

Full C/C++ logs: https://pastebin.com/WQ93WH89

Other Extensions

No response

Additional context

Related to:

主要语言
TypeScript
星标
6.2k
派生
1.7k
平均合并
1 天 4 小时
30 天内合并 PR
58

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/vscode-cpptools 的其他 Issue

查看 microsoft/vscode-cpptools 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。