warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

Silverridge
Posts: 1
Joined: Tue Apr 26, 2022 8:01 am

warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

Postby Silverridge » Tue Apr 26, 2022 9:10 am

Hi everyone,

I'm an beginner with esp32s so please bare with me.
I am getting this error message:

Code: Select all

In file included from C:\Temp\flora2\flora2.ino:38:
C:\Temp\flora2\config.h:9:1: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
when uploading the code from this site: https://github.com/RonnyWinkler/esp32.miflora
The altered config.h looks like this in the beginning (the first 9 lines):

Code: Select all

// array of different xiaomi flora MAC addresses
char* FLORA_DEVICES[] = {
    "C4:7C:8D:6D:EE:BA", 
    "C4:7C:8D:6E:1D:27",
    "C4:7C:8D:6E:02:A9",
    "C4:7C:8D:6E:01:09",    
    "C4:7C:8D:6E:1D:8A"
};
I am using these ESP's: https://www.amazon.de/gp/product/B09PLC ... =UTF8&th=1 (NodeMCU ESP32 S)

What am I missing or doing wrong?

Who is online

Users browsing this forum: Bing [Bot] and 105 guests