Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Malloc Shows Error in Intellisense but Compiles and Runs on MKR1000 (Read 902 times)
yaletowneric
Newbies
*
Offline


Posts: 8
Joined: Jul 8th, 2020
Malloc Shows Error in Intellisense but Compiles and Runs on MKR1000
Jul 23rd, 2020 at 4:34am
Print Post  
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!
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2174
Joined: Feb 13th, 2019
Re: Malloc Shows Error in Intellisense but Compiles and Runs on MKR1000
Reply #1 - Jul 23rd, 2020 at 5:28pm
Print Post  
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
  
Back to top
 
IP Logged
 
yaletowneric
Newbies
*
Offline


Posts: 8
Joined: Jul 8th, 2020
Re: Malloc Shows Error in Intellisense but Compiles and Runs on MKR1000
Reply #2 - Jul 26th, 2020 at 12:12am
Print Post  
That got it, thanks!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint