Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 
When Logging a Support Issue in the Forum, please ensure you have also:-
  • Enabled vMicro > Compiler > Show Build Properties and Verbose
  • 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
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
Malloc Shows Error in Intellisense but Compiles and Runs on MKR1000 (Read 94 times)
yaletowneric
Newbies
*
Offline



Posts: 8
Malloc Shows Error in Intellisense but Compiles and Runs on MKR1000
Jul 23rd, 2020 at 5: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!
Back to top
 
 
IP Logged
 
Simon Hopkinson
Administrator
*****
Offline



Posts: 356
Re: Malloc Shows Error in Intellisense but Compiles and Runs on MKR1000
Reply #1 - Jul 23rd, 2020 at 6: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
Back to top
 
 
IP Logged
 
yaletowneric
Newbies
*
Offline



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