Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 

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



Posts: 3
IntelliSense reports memset, memcpy and memcmp as undefined
Aug 12th, 2022 at 9:38am
 
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:
#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
Back to top
 

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



Posts: 11537
United Kingdom
Re: IntelliSense reports memset, memcpy and memcmp as undefined
Reply #1 - Aug 12th, 2022 at 2:37pm
 
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++):
//#if defined(_VMICRO_INTELLISENSE)
    byte buf[5] = { 0 };
    // IDE reports memset as "identifier is undefined"
    memset(buf, 0xFF, sizeof(buf));
//#endif 

Back to top
 

Tim Leek
home
WWW  
IP Logged
 
HugoP
Newbies
*
Offline



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

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

Find build log attached.

Code:
#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:
}
 

Back to top
 

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



Posts: 1576
Re: IntelliSense reports memset, memcpy and memcmp as undefined
Reply #3 - Aug 23rd, 2022 at 2:05pm
 
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
Re: IntelliSense reports memset, memcpy and memcmp as undefined
Reply #4 - Aug 23rd, 2022 at 6:59pm
 
Thank you for the new release!  Smiley
Looking good.
Back to top
 
 
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print