1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-11-28 17:36:39 +03:00

Libraries - fix some warnings with gcc ≥12 (#9244)

* ESP8266WebServer - unused templated code throws out unused statics

currently, only w/ mock build because it is using gcc>=12

> ../../libraries/ESP8266WebServer/src/detail/RequestHandlersImpl.h:14:15: warning: ‘String esp8266webserver::calcETag(fs::FS&, const String&)’ defined but not used [-Wunused-function]
>   14 | static String calcETag(FS &fs, const String &path) {
>      |               ^~~~~~~~

* ESP8266WiFiMesh - fix classes used as aggregates

> error: designated initializers cannot be used with a non-aggregate type '...'

gcc10.3 allowed this construct for some reason

* LEAmDNS - consistent const <-> non-const accessors

> error: infinite recursion detected [-Werror=infinite-recursion]
This commit is contained in:
Max Prokhorov
2025-05-20 19:40:21 +03:00
committed by GitHub
parent 606324ccf8
commit 2c72e6f015
6 changed files with 44 additions and 36 deletions

View File

@@ -1735,15 +1735,6 @@ namespace MDNSImplementation
const MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address*
MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address(
const IPAddress& p_IPAddress) const
{
return (stcIP4Address*)(((const stcAnswer*)this)->findIP4Address(p_IPAddress));
}
/*
MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address
*/
MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address*
MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address(const IPAddress& p_IPAddress)
{
stcIP4Address* pIP4Address = m_pIP4Addresses;
while (pIP4Address)
@@ -1757,6 +1748,16 @@ namespace MDNSImplementation
return pIP4Address;
}
/*
MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address
*/
MDNSResponder::stcMDNSServiceQuery::stcAnswer::stcIP4Address*
MDNSResponder::stcMDNSServiceQuery::stcAnswer::findIP4Address(const IPAddress& p_IPAddress)
{
const auto& cref = static_cast<const decltype(*this)>(*this);
return const_cast<stcIP4Address*>(cref.findIP4Address(p_IPAddress));
}
/*
MDNSResponder::stcMDNSServiceQuery::stcAnswer::IP4AddressCount
*/
@@ -2033,7 +2034,8 @@ namespace MDNSImplementation
MDNSResponder::stcMDNSServiceQuery::stcAnswer*
MDNSResponder::stcMDNSServiceQuery::answerAtIndex(uint32_t p_u32Index)
{
return (stcAnswer*)(((const stcMDNSServiceQuery*)this)->answerAtIndex(p_u32Index));
const auto& cref = static_cast<const decltype(*this)>(*this);
return const_cast<stcAnswer*>(cref.answerAtIndex(p_u32Index));
}
/*