Open sslupsky opened 5 years ago
I am using the arduino CLI to compile.
arduino-cli Version: 0.3.7-alpha.preview
The target is a MKRWAN1300 that uses the SAMD21 mcu.
same with stm32duino
This library appears to have been written for the AVR compiler, which does not return any errors on this line. Atmel SAM compilers return an error.
I was able to compile for an Adafruit Feather M0 by changing the offending line to include a cast, as follows:
return (char)'\0';
original:
return '\0';
hmmm...:
return NULL;
better:
return nullptr;
original:
return '\0';
hmmm...:
return NULL;
better:
return nullptr;
Actually...that's a good point. Looking at the code, I think the author maybe intended to return an empty string - but instead effectively returned NULL. I'm not sure; I feel like it could go either way.
Encountered the following error when attempting to compile a sketch using CmdMessenger:
The function is defined to return a pointer as follows; https://github.com/thijse/Arduino-CmdMessenger/blob/8c3c4446fa593b8ea96a350c99aa93e7b471fc82/CmdMessenger.cpp#L484
Since the function is returning a char instead of a pointer, this is causing a compiler error.
Should the correct return value be NULL? ie:
return NULL;