VS Arduino
Visual Micro >> Visual Studio 2017, 2019, 2022 >> Malloc Shows Error in Intellisense but Compiles and Runs on MKR1000
https://www.visualmicro.com/forums/YaBB.pl?num=1595478843

Message started by yaletowneric on Jul 23rd, 2020 at 4:34am

Title: Malloc Shows Error in Intellisense but Compiles and Runs on MKR1000
Post by yaletowneric on Jul 23rd, 2020 at 4:34am
When vMicro is set to target my MKR1000 and I use malloc (for example s = (char*)malloc(5000), with s being a char*) in a sketch on my MKR1000 Intellisense flags it as an error and hovering over the error shows it defined as char* malloc(). It does compile, run and allocate the memory correctly though.

If I try to assign it to s without the cast and argument like Intellisense suggest (for example s = malloc(), which is of course wouldn't actually do anything) the compiler fails.

Finally if I pick a random board from the target drop down (in this case I tried ATMega328P) the Intellisense error goes away and it will also compile fine. I don't have a board to test it on, but I'm going to assume that it would run as expected.

Any suggestions? Thanks!

Title: Re: Malloc Shows Error in Intellisense but Compiles and Runs on MKR1000
Post by Simon Hopkinson on Jul 23rd, 2020 at 5:28pm
We have added an intellisense fix for this issue, which is available in the 20.07.08.4 release at the top of the below board:-

https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES

Title: Re: Malloc Shows Error in Intellisense but Compiles and Runs on MKR1000
Post by yaletowneric on Jul 26th, 2020 at 12:12am
That got it, thanks!

VS Arduino » Powered by YaBB 2.6.12!
YaBB Forum Software © 2000-2024. All Rights Reserved.