ppedro74 / Arduino-SerialCommands

BSD 3-Clause "New" or "Revised" License
87 stars 29 forks source link

Fix for const char* conversion warnings. #7

Open neltnerb opened 5 years ago

neltnerb commented 5 years ago

Tested and verified on Teensy 3.6. Apologies, I don't know how to properly submit a patch but the changes are very simple.

Change function definition for SerialCommands to: SerialCommands(Stream* serial, char* buffer, int16_t buffer_len, const char* term = "\r\n", const char* delim = " ") :

to avoid warnings related to converting a const char to char in the latest GCC versions. The termination character and delimiter are usually fixed after configuring, not sure if you intended the ability to change these on the fly as a feature or if that's incidental.

I also changed the private variable types for term and delim to const char* as well.

I think I probably only noticed because I set it up to give me all compiler warnings, it seemed to work fine both ways.

yawor commented 3 years ago

@neltnerb this has been fixed around 2017, but the fix has not been published as the version was not changed. Just check the source files.