I have a program that’s sending data back and forth on the serial port. This morning mbed studio asked if I wanted to install some tool updates, to which I (foolishly) said yes. Now I get errors wherever I use the memset function to clear a serial read/write buffer. I rolled the whole thing back to a previously comitted version that I know worked and the errors pop up in it too. I created a new program with only memset and a new copy of mbed 6.14, same problem. It compiles just fine in the online compiler.
The errors and code are below:
Use of undeclared identifier ‘memset’; did you mean ‘wmemset’? (fix available)
Cannot initialize a parameter of type ‘wchar_t *’ with an lvalue of type ‘char [128]’
#include "mbed.h"
char serialRxBuf[128];
int main()
{
memset(serialRxBuf,0,sizeof(serialRxBuf));
while (true) {
}
}
It should have been compilable, but it wasn’t compiling. On a whim I reinstalled mbed studio and both the failure to compile and the errors disappeared.