Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.
This repository was archived by the owner on Oct 1, 2024. It is now read-only.

Intellisense / problems list getting confused by pgm_read_word #1185

Closed
@DavidShoe

Description

@DavidShoe

const char string_1[] PROGMEM = "Learn";
void setup(){
char buffer[15]="";
strcpy_P(buffer, (char *)pgm_read_word(&string_1)); // Necessary casts and dereferencing, just copy.
}

void loop() {
}

This compiles fine and runs as expected. But inilllisense is confused by the pgm_read_word macro resulting in the following problems being shown. And it breaks things for later lines of code throwing spurious problems that go away if this line is commented out.
{
"resource": "/c:/projects/vscodebug/vscodebug.ino",
"owner": "C/C++",
"code": "254",
"severity": 8,
"message": "type name is not allowed",
"source": "C/C++",
"startLineNumber": 4,
"startColumn": 28,
"endLineNumber": 4,
"endColumn": 41
}

{
"resource": "/c:/projects/vscodebug/vscodebug.ino",
"owner": "C/C++",
"code": "169",
"severity": 8,
"message": "expected a declaration",
"source": "C/C++",
"startLineNumber": 5,
"startColumn": 1,
"endLineNumber": 5,
"endColumn": 2
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions