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

Multiple warnings ISO C++ forbids converting a string constant to 'char*' [-Write-strings] #301

Open
ralbright-wa opened this issue Oct 25, 2021 · 0 comments

Comments

@ralbright-wa
Copy link

Been getting multiple warnings in my IDE when calling declaring the rest function.

This code:
rest.function("button1", pushButton1); // Chapel projector power on

generates the warning 'ISO C++ forbids converting a string constant to 'char*'.

I am of the programming mind to avoid even warnings in my code, because today's warnings may be tomorrow's errors. One thing I did was change the code to this:
rest.function((char*)"button1", pushButton1); // Chapel projector power on
This did get rid of the warning, but I have not tested it yet. (Need to go to my church to implement it. (The Arduino Mega is there with the equipment I am working on.)

Is there a reason that the scripted examples are causing these warnings?

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

1 participant