marcoschwartz / aREST

A RESTful environment for Arduino
http://aREST.io/
Other
1.2k stars 279 forks source link

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

Open ralbright-wa opened 2 years ago

ralbright-wa commented 2 years ago

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?