Skip to content
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 opened this issue Jan 17, 2021 · 1 comment
Closed

Intellisense / problems list getting confused by pgm_read_word #1185

DavidShoe opened this issue Jan 17, 2021 · 1 comment

Comments

@DavidShoe
Copy link

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
}

@adiazulay
Copy link
Contributor

This issue is being tracked with #438 and is fixed in #1183. There will be a release candidate with the fixes in the next week or so.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants