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

C++ using new/delete #86

Open
panchev68 opened this issue Dec 30, 2024 · 1 comment
Open

C++ using new/delete #86

panchev68 opened this issue Dec 30, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@panchev68
Copy link

panchev68 commented Dec 30, 2024

Describe the bug:

If I try to create an object with new vscode generates an error: "operator delete" is ambiguous C/C++(266)"

There is no redefinition of the new and delete operators.

To Reproduce:

image

Environment:

OS: Windows 11
Embedded Workbench: Arm
VSC Extension version: 1.30.7

Additional context:

This happens if the "configurationProvider": "iarsystems.iar-build" field is changed in the c_cpp_properties.json file. if the extension https://marketplace.visualstudio.com/items?itemName=pluyckx.iar-vsc is used this problem does not exist , but unfortunately it [ Deprecated]

@panchev68 panchev68 added the bug Something isn't working label Dec 30, 2024
@HampusAdolfsson HampusAdolfsson self-assigned this Jan 7, 2025
@HampusAdolfsson
Copy link
Collaborator

Hi!

We've fixed the issue, and it should work as expected in the next release. In the meantime, you can add the following to your Iar-build: Defines setting:

__data=

Or in your settings.json file:

{
    "iar-build.defines": [
        // Default entries here...
        "__data=",
    ]
}

The IAR <new> header uses the __data keyword, which is intrinsic to IAR compilers and not recognized by the parser used by VS Code's intellisense. By adding __data as an empty preprocessor macro, we can make the parser ignore that keyword and parse the header correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants