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 IntelliSense reports memset, memcpy and memcmp as undefined (Read 1688 times)
HugoP
Newbies
*
Offline


Posts: 3
Joined: Aug 11th, 2022
IntelliSense reports memset, memcpy and memcmp as undefined
Aug 12th, 2022 at 8:38am
Print Post  
Been doing some development using VSMicro on VS 2022 for ESP32 and love the tool chain.

But recently I had to switch to ATtiny3216 and found one annoyance that is growing as the code base grows.

Using
Windows 10
Visual Studio 2022 v17.3
Visual Micro 2022.611.2204
megaTinyCore v2.5.11 https://github.com/SpenceKonde/ATTinyCore ;

The following code compiles and works, but the IDE reports memset as undefined with red squiggly.

Code
Select All
#include <Arduino.h>
#include <string.h>

void setup()
{
#if defined(_VMICRO_INTELLISENSE)
    byte buf[5] = { 0 };
    // IDE reports memset as "identifier is undefined"
    memset(buf, 0xFF, sizeof(buf)); 
#endif
}

void loop()
{

}
 



Let me know if I missed something.

PS: Switching to ESP32 board does not suffer from this.

Best wishes
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: IntelliSense reports memset, memcpy and memcmp as undefined
Reply #1 - Aug 12th, 2022 at 1:37pm
Print Post  
Thanks for the clear info. Before we look into this I need to point out that the following code will never be compiled. The define you have used might normally be in a seperate .h file simply to fudge intellisense.

Let us first see if the board actually supports memset. Please comment out the #if and click build.

Code (C++)
Select All
//#if defined(_VMICRO_INTELLISENSE)
    byte buf[5] = { 0 };
    // IDE reports memset as "identifier is undefined"
    memset(buf, 0xFF, sizeof(buf));
//#endif 

  
Back to top
WWW  
IP Logged
 
HugoP
Newbies
*
Offline


Posts: 3
Joined: Aug 11th, 2022
Re: IntelliSense reports memset, memcpy and memcmp as undefined
Reply #2 - Aug 15th, 2022 at 8:14am
Print Post  
Ok

The following code compiles and I receive "memset worked" in terminal.

Find build log attached.

Code
Select All
#include <Arduino.h>
#include <string.h>

void setup()
{
    byte buffer[5] = { 0 };
    memset(buffer, 0xFF, sizeof(buffer));

    Serial.begin(9600);
    if (buffer[0] == 0xFF)
    {
        Serial.println("memset worked");
    }
}

void loop()
{
    // put your main code here, to run repeatedly:
}
 

  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2143
Joined: Feb 13th, 2019
Re: IntelliSense reports memset, memcpy and memcmp as undefined
Reply #3 - Aug 23rd, 2022 at 1:05pm
Print Post  
The intellisense issue should be improved in the latest release (22.08.23.00) which is available from the top of the below board:
https://www.visualmicro.com/forums/YaBB.pl?board=VS_ARDUINO_EXT_RELEASES
  
Back to top
 
IP Logged
 
HugoP
Newbies
*
Offline


Posts: 3
Joined: Aug 11th, 2022
Re: IntelliSense reports memset, memcpy and memcmp as undefined
Reply #4 - Aug 23rd, 2022 at 5:59pm
Print Post  
Thank you for the new release!  Smiley
Looking good.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint