Skip to content

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

@TracerDS

Description

@TracerDS

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:

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