marcoschwartz / aREST

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

Warnings #170

Open jrevet opened 7 years ago

jrevet commented 7 years ago

Hi, i want to discover the API (2.5.0) and i have some warnings, that seems not serious.

In file included from /Users/jacky/Documents/Arduino/sketch_sep20a/sketch_sep20a.ino:4:0: /Users/jacky/Documents/Arduino/libraries/aREST/aREST.h: In member function 'bool aREST::send_command(bool)': /Users/jacky/Documents/Arduino/libraries/aREST/aREST.h:1338:28: warning: deprecated conversion from string constant to 'char' [-Wwrite-strings] addToBuffer(HARDWARE); ^ /Users/jacky/Documents/Arduino/libraries/aREST/aREST.h: In member function 'virtual void aREST::root_answer()': /Users/jacky/Documents/Arduino/libraries/aREST/aREST.h:1451:23: warning: deprecated conversion from string constant to 'char' [-Wwrite-strings] addToBuffer(HARDWARE); ^ Best regards Jacky

marcoschwartz commented 7 years ago

Hello, thanks for using aREST! Indeed if it is just warning nothing alarming, but I'll have a look into it :)

confusedtoo commented 7 years ago

The ones involving "HARDWARE" are fixed by changing line 1621 of aREST.h from: void addToBuffer(char toAdd){ to: void addToBuffer(const char toAdd){

The newer version compilers want to have the string defined as a constant not let the compiler make that decision. The others are similar string pointer problems but haven't found the fix. IMHO At least my take on it! Don't like modifying someone else's code, sorry. Dave