怎么阻止esp32 sdk编译时刻 对 blinker 的ISO C++警告信息?-Arduino中文社区 - Powered by Discuz!

Arduino中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 445|回复: 2

[分享] 怎么阻止esp32 sdk编译时刻 对 blinker 的ISO C++警告信息?

[复制链接]
发表于 2022-4-16 15:21 | 显示全部楼层 |阅读模式
In file included from E:\MyFiles\Documents\Arduino\libraries\Blinker\src/BlinkerESPMQTT.h:16,
from E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker.h:43,
                 from d:\esp\esp32c3\led_test\test.ino:4:
E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Adapters/BlinkerMQTT.h: In member function 'virtual char* BlinkerMQTT::token()':
E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Adapters/BlinkerMQTT.h:141:50: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
char * token() { if (!isMQTTinit) return ""; else return MQTT_KEY_MQTT; }
                                                  ^~
In file included from E:\MyFiles\Documents\Arduino\libraries\Blinker\src/BlinkerESPMQTT.h:16,
from E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker.h:43,
                 from d:\esp\esp32c3\led_test\test.ino:4:
E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Adapters/BlinkerMQTT.h: In member function 'virtual char* BlinkerMQTT::lastRead()':
E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Adapters/BlinkerMQTT.h:954:17: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
else return "";
                 ^~
In file included from E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h:95,
from E:\MyFiles\Documents\Arduino\libraries\Blinker\src/BlinkerESPMQTT.h:17,
                 from E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker.h:43,
from d:\esp\esp32c3\led_test\test.ino:4:
E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApiBase.h: In member function 'char* BlinkerBridge_key::getName()':
E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApiBase.h:196:29: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
else return "false";
                             ^~~~~~~
In file included from E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h:96,
from E:\MyFiles\Documents\Arduino\libraries\Blinker\src/BlinkerESPMQTT.h:17,
from E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker.h:43,
                 from d:\esp\esp32c3\led_test\test.ino:4:
E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerProtocol.h: In member function 'char* BlinkerProtocol::deviceName()':
E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerProtocol.h:104:86: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
             char * deviceName() { if (isInit) return conn->deviceName(); else return ""; }
^~
E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerProtocol.h: In member function 'char* BlinkerProtocol::authKey()':
E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerProtocol.h:105:83: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
char * authKey()    { if (isInit) return conn->authKey(); else return "";  }
^~
E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerProtocol.h: In member function 'char* BlinkerProtocol::token()':
E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerProtocol.h:106:79: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
char * token()    { if (isInit) return conn->token(); else return "";  }
^~
E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerProtocol.h: In member function 'char* BlinkerProtocol::dataParse()':
E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerProtocol.h:257:86: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
char* dataParse()       { if (canParse) return conn->lastRead(); else return ""; }
^~
In file included from E:\MyFiles\Documents\Arduino\libraries\Blinker\src/BlinkerESPMQTT.h:17,
from E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker.h:43,
                 from d:\esp\esp32c3\led_test\test.ino:4:
E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h: At global scope:
E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h:913:97: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
BlinkerWidgets_string _BUILTIN_SWITCH = BlinkerWidgets_string(BLINKER_CMD_BUILTIN_SWITCH);
^
In file included from E:\MyFiles\Documents\Arduino\libraries\Blinker\src/BlinkerESPMQTT.h:17,
from E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker.h:43,
                 from d:\esp\esp32c3\led_test\test.ino:4:
E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::bridgeKey(uint8_t)':
E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h:7831:21: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
         else return "";
                     ^~
E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::bridgeName(uint8_t)':
E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h:7838:21: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
else return "false";
                     ^~~~~~~
In file included from E:\MyFiles\Documents\Arduino\libraries\Blinker\src/BlinkerESPMQTT.h:17,
from E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker.h:43,
                 from d:\esp\esp32c3\led_test\test.ino:4:
E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_str(uint8_t)':
E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h:8467:17: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
else return "";
                 ^~
E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_joy(uint8_t)':
E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h:8474:21: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
else return "";
                     ^~
E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_rgb(uint8_t)':
E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h:8481:17: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
     else return "";
                 ^~
E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_int(uint8_t)':
E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h:8487:17: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
     else return "";
^~
E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_tab(uint8_t)':
E:\MyFiles\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h:8493:17: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
     else return "";
^~
d:\esp\esp32c3\led_test\test.ino: At global scope:
d:\esp\esp32c3\led_test\test.ino:10:32: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
BlinkerText tex_stat("tex-stat");
^
d:\esp\esp32c3\led_test\test.ino:11:32: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
BlinkerButton btn_wol("btn-wol");
                                ^
In file included from E:\MyFiles\Documents\Arduino\libraries\Blinker\src\modules\WebSockets\WebSockets.cpp:47:
C:\Users\Tiyor\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.2/tools/sdk/esp32c3/include/mbedtls/port/include/esp32/sha.h:20:2: warning: #warning esp32/sha.h is deprecated, please use sha_parallel_engine.h instead [-Wcpp]
#warning esp32/sha.h is deprecated, please use sha_parallel_engine.h instead
  ^~~~~~~
In file included from E:\MyFiles\Documents\Arduino\libraries\Blinker\src\modules\painlessMesh\painlessmesh/ntp.hpp:15,
from E:\MyFiles\Documents\Arduino\libraries\Blinker\src\modules\painlessMesh\painlessmesh/mesh.hpp:6,
from E:\MyFiles\Documents\Arduino\libraries\Blinker\src\modules\painlessMesh\painlessMeshConnection.h:19,
from E:\MyFiles\Documents\Arduino\libraries\Blinker\src\modules\painlessMesh\painlessMeshConnection.cpp:9:
E:\MyFiles\Documents\Arduino\libraries\Blinker\src\modules\painlessMesh\painlessmesh/router.hpp: In function 'void painlessmesh::router::handleNodeSync(T&, painlessmesh::protocol::NodeTree, std::shared_ptr<_Tp>)':
E:\MyFiles\Documents\Arduino\libraries\Blinker\src\modules\painlessMesh\painlessmesh/router.hpp:201:26: warning: lambda capture initializers only available with -std=c++14 or -std=gnu++14
mesh.addTask([&mesh, remoteNodeId = newTree.nodeId]() {
                          ^~~~~~~~~~~~
In file included from e:\myfiles\documents\arduino\libraries\blinker\src\modules\painlessmesh\painlessmesh/ntp.hpp:15,
from e:\myfiles\documents\arduino\libraries\blinker\src\modules\painlessmesh\painlessmesh/mesh.hpp:6,
from e:\myfiles\documents\arduino\libraries\blinker\src\modules\painlessmesh\painlessmeshconnection.h:19,
from E:\MyFiles\Documents\Arduino\libraries\Blinker\src\modules\painlessMesh\arduino/wifi.hpp:7,
from E:\MyFiles\Documents\Arduino\libraries\Blinker\src\modules\painlessMesh\painlessMeshSTA.cpp:13:
e:\myfiles\documents\arduino\libraries\blinker\src\modules\painlessmesh\painlessmesh/router.hpp: In function 'void painlessmesh::router::handleNodeSync(T&, painlessmesh::protocol::NodeTree, std::shared_ptr<_Tp>)':
e:\myfiles\documents\arduino\libraries\blinker\src\modules\painlessmesh\painlessmesh/router.hpp:201:26: warning: lambda capture initializers only available with -std=c++14 or -std=gnu++14
mesh.addTask([&mesh, remoteNodeId = newTree.nodeId]() {
                          ^~~~~~~~~~~~
In file included from e:\myfiles\documents\arduino\libraries\blinker\src\modules\painlessmesh\painlessmesh/ntp.hpp:15,
from e:\myfiles\documents\arduino\libraries\blinker\src\modules\painlessmesh\painlessmesh/mesh.hpp:6,
from e:\myfiles\documents\arduino\libraries\blinker\src\modules\painlessmesh\painlessmeshconnection.h:19,
from E:\MyFiles\Documents\Arduino\libraries\Blinker\src\modules\painlessMesh\arduino/wifi.hpp:7,
from E:\MyFiles\Documents\Arduino\libraries\Blinker\src\modules\painlessMesh\wifi.cpp:2:
e:\myfiles\documents\arduino\libraries\blinker\src\modules\painlessmesh\painlessmesh/router.hpp: In function 'void painlessmesh::router::handleNodeSync(T&, painlessmesh::protocol::NodeTree, std::shared_ptr<_Tp>)':
e:\myfiles\documents\arduino\libraries\blinker\src\modules\painlessmesh\painlessmesh/router.hpp:201:26: warning: lambda capture initializers only available with -std=c++14 or -std=gnu++14
mesh.addTask([&mesh, remoteNodeId = newTree.nodeId]() {
^~~~~~~~~~~~
E:\MyFiles\Documents\Arduino\libraries\Blinker\src\modules\painlessMesh\painlessMeshConnection.cpp: In member function 'void MeshConnection::initTCPCallbacks()':
E:\MyFiles\Documents\Arduino\libraries\Blinker\src\modules\painlessMesh\painlessMeshConnection.cpp:55:8: warning: lambda capture initializers only available with -std=c++14 or -std=gnu++14
[self = this->shared_from_this(), m = this->mesh](void *arg,
        ^~~~
E:\MyFiles\Documents\Arduino\libraries\Blinker\src\modules\painlessMesh\painlessMeshConnection.cpp:55:41: warning: lambda capture initializers only available with -std=c++14 or -std=gnu++14
[self = this->shared_from_this(), m = this->mesh](void *arg,
                                         ^
E:\MyFiles\Documents\Arduino\libraries\Blinker\src\modules\painlessMesh\painlessMeshConnection.cpp:67:8: warning: lambda capture initializers only available with -std=c++14 or -std=gnu++14
[self = this->shared_from_this()](void *arg, AsyncClient *client,
        ^~~~
E:\MyFiles\Documents\Arduino\libraries\Blinker\src\modules\painlessMesh\painlessMeshConnection.cpp:86:8: warning: lambda capture initializers only available with -std=c++14 or -std=gnu++14
[self = this->shared_from_this()](void *arg, AsyncClient *client,
        ^~~~
E:\MyFiles\Documents\Arduino\libraries\Blinker\src\modules\painlessMesh\painlessMeshConnection.cpp:97:8: warning: lambda capture initializers only available with -std=c++14 or -std=gnu++14
       [self = this->shared_from_this()](void *arg, AsyncClient *client,
^~~~
E:\MyFiles\Documents\Arduino\libraries\Blinker\src\modules\painlessMesh\painlessMeshConnection.cpp: In member function 'void MeshConnection::initTasks()':
E:\MyFiles\Documents\Arduino\libraries\Blinker\src\modules\painlessMesh\painlessMeshConnection.cpp:114:45: warning: lambda capture initializers only available with -std=c++14 or -std=gnu++14
timeOutTask.set(NODE_TIMEOUT, TASK_ONCE, [self = this->shared_from_this()]() {
                                             ^~~~
E:\MyFiles\Documents\Arduino\libraries\Blinker\src\modules\painlessMesh\painlessMeshConnection.cpp:121:35: warning: lambda capture initializers only available with -std=c++14 or -std=gnu++14
TASK_MINUTE, TASK_FOREVER, [self = this->shared_from_this()]() {
                                   ^~~~
E:\MyFiles\Documents\Arduino\libraries\Blinker\src\modules\painlessMesh\painlessMeshConnection.cpp:136:35: warning: lambda capture initializers only available with -std=c++14 or -std=gnu++14
TASK_SECOND, TASK_FOREVER, [self = this->shared_from_this()]() {
                                   ^~~~
E:\MyFiles\Documents\Arduino\libraries\Blinker\src\modules\painlessMesh\painlessMeshConnection.cpp:152:35: warning: lambda capture initializers only available with -std=c++14 or -std=gnu++14
TASK_SECOND, TASK_FOREVER, [self = this->shared_from_this()]() {
                                   ^~~~
E:\MyFiles\Documents\Arduino\libraries\Blinker\src\modules\painlessMesh\painlessMeshConnection.cpp: In member function 'void MeshConnection::close()':
E:\MyFiles\Documents\Arduino\libraries\Blinker\src\modules\painlessMesh\painlessMeshConnection.cpp:189:8: warning: lambda capture initializers only available with -std=c++14 or -std=gnu++14
[mesh = this->mesh, nodeId = this->nodeId, station = this->station]() {
        ^~~~
E:\MyFiles\Documents\Arduino\libraries\Blinker\src\modules\painlessMesh\painlessMeshConnection.cpp:189:27: warning: lambda capture initializers only available with -std=c++14 or -std=gnu++14
[mesh = this->mesh, nodeId = this->nodeId, station = this->station]() {
                           ^~~~~~
E:\MyFiles\Documents\Arduino\libraries\Blinker\src\modules\painlessMesh\painlessMeshConnection.cpp:189:50: warning: lambda capture initializers only available with -std=c++14 or -std=gnu++14
[mesh = this->mesh, nodeId = this->nodeId, station = this->station]() {
^~~~~~~


 楼主| 发表于 2022-4-16 17:05 | 显示全部楼层
  搜到了  
ino 文件最上面添加

#pragma GCC diagnostic ignored "-Wwrite-strings"

就屏蔽这条警告了

发表于 2022-4-29 15:04 | 显示全部楼层
请问,ino文件是哪个?Arduino file么?我在最上面加了,但还是有这个错误
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|Archiver|手机版|Arduino中文社区

GMT+8, 2024-11-28 09:25 , Processed in 0.071205 second(s), 15 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表