You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my Arduino code I am defining: const char* mysql_user= "user";
Using const as best practice for defining strings this way (and to prevent compiler warnings like ISO C++ forbids converting a string constant to 'char*').
When calling conn.connect(mysql_server, 3306, mysql_user, mysql_password)
I get a compiler error: error: invalid conversion from 'const char*' to 'char*'
I looked at the signature of connect: boolean MySQL_Connection::connect(IPAddress server, int port, char *user, char *password, char *db)
And I wonder why user, password, and db are not defined as const char, as I do not see them changed anywhere.
Any suggestions how to best solve this?
Yep. Change it yourself on your PC. :) If it works and you’re happy with
it, you are welcome to make a pill request and submit the change. Behold,
the power of open source!
On Thu, May 18, 2023 at 13:08 EdwinGH ***@***.***> wrote:
In my Arduino code I am defining:
const char* mysql_user= "user";
Using const as best practice for defining strings this way (and to prevent
compiler warnings like *ISO C++ forbids converting a string constant to
'char*'*).
When calling
conn.connect(mysql_server, 3306, mysql_user, mysql_password)
I get a compiler error:
*error: invalid conversion from 'const char*' to 'char*'*
I looked at the signature of connect:
boolean MySQL_Connection::connect(IPAddress server, int port, char *user,
char *password, char *db)
And I wonder why user, password, and db are not defined as const char, as
I do not see them changed anywhere.
Any suggestions how to best solve this?
—
Reply to this email directly, view it on GitHub
<#211>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB6SHYGU3A3XXEPZRHJZXNLXGZJSPANCNFSM6AAAAAAYGXAE2Y>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
Sorry, I didn’t fully answer your question. I made the original code to an
LCD standard. Most board compilers understand char * but at the time fewer
would permit Cindy char * and there are use cases for not using const.
On Thu, May 18, 2023 at 13:08 EdwinGH ***@***.***> wrote:
In my Arduino code I am defining:
const char* mysql_user= "user";
Using const as best practice for defining strings this way (and to prevent
compiler warnings like *ISO C++ forbids converting a string constant to
'char*'*).
When calling
conn.connect(mysql_server, 3306, mysql_user, mysql_password)
I get a compiler error:
*error: invalid conversion from 'const char*' to 'char*'*
I looked at the signature of connect:
boolean MySQL_Connection::connect(IPAddress server, int port, char *user,
char *password, char *db)
And I wonder why user, password, and db are not defined as const char, as
I do not see them changed anywhere.
Any suggestions how to best solve this?
—
Reply to this email directly, view it on GitHub
<#211>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB6SHYGU3A3XXEPZRHJZXNLXGZJSPANCNFSM6AAAAAAYGXAE2Y>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
I have made a fork, did the proposed changes, checked that it solves the issue, and submitted the pull request. First time I'm doing this (thanks for encouraging me!), so not sure what happens next. On my side things are working, so happy anyway!
Activity
ChuckBell commentedon May 18, 2023
ChuckBell commentedon May 18, 2023
EdwinGH commentedon May 20, 2023
I have made a fork, did the proposed changes, checked that it solves the issue, and submitted the pull request. First time I'm doing this (thanks for encouraging me!), so not sure what happens next. On my side things are working, so happy anyway!