Intellisense / problems list getting confused by pgm_read_word #1185
Description
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
}