Skip to content

LeaMDNS lambda capture initializer C++ standard warnings #6253

Closed
@earlephilhower

Description

@earlephilhower

We build the core with --std=c++11, but the following warning about using something only available under C++14 or later comes up with -wextra.

@LaborEtArs, can you please take a quick look at these and see if we're good or if the compiler is silently ignoring your initializer?

C++ ../../libraries/ESP8266WiFi/src/ESP8266WiFiSTA-WPS.cpp.32.o
../../libraries/ESP8266mDNS/src/LEAmDNS.cpp: In member function ‘bool esp8266::MDNSImplementation::MDNSResponder::setHostProbeResultCallback(esp8266::MDNSImplementation::MDNSResponder::MDNSHostProbeFn1)’:
../../libraries/ESP8266mDNS/src/LEAmDNS.cpp:1054:40: warning: lambda capture initializers only available with -std=c++14 or -std=gnu++14
     return setHostProbeResultCallback([resp=std::ref(*this), pfn](const char* p_pcDomainName, bool p_bProbeResult) { pfn(resp, p_pcDomainName, p_bProbeResult); });
                                        ^~~~
../../libraries/ESP8266mDNS/src/LEAmDNS.cpp: In member function ‘bool esp8266::MDNSImplementation::MDNSResponder::setServiceProbeResultCallback(esp8266::MDNSImplementation::MDNSResponder::hMDNSService, esp8266::MDNSImplementation::MDNSResponder::MDNSServiceProbeFn1)’:
../../libraries/ESP8266mDNS/src/LEAmDNS.cpp:1083:55: warning: lambda capture initializers only available with -std=c++14 or -std=gnu++14
     return setServiceProbeResultCallback(p_hService, [resp=std::ref(*this), p_fnCallback](const char* p_pcServiceName, const hMDNSService p_hMDNSService, bool p_bProbeResult) {
                                                       ^~~~

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions