Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for const char* conversion warnings. #7

Open
neltnerb opened this issue May 9, 2019 · 1 comment
Open

Fix for const char* conversion warnings. #7

neltnerb opened this issue May 9, 2019 · 1 comment

Comments

@neltnerb
Copy link

neltnerb commented May 9, 2019

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
Copy link

yawor commented Nov 27, 2020

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants