1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-12 01:53:07 +03:00

Add -Werror to acceptance builds for C and CPP (#4369)

Use platform.local.txt to add -Werror to GCC for the build of all
code.  Any warnings on a submitted patch will cause an error.

Several examples and libraries had warnings/errors (missing returns
on functions, types, etc.).  Clean those up with this commit as well.
This commit is contained in:
Earle F. Philhower, III
2018-02-17 18:47:10 -08:00
committed by GitHub
parent ad42ab69c1
commit f9ac524b13
22 changed files with 73 additions and 51 deletions

View File

@ -87,10 +87,12 @@ bool LLMNRResponder::begin(const char* hostname) {
_hostname.toLowerCase();
_sta_got_ip_handler = WiFi.onStationModeGotIP([this](const WiFiEventStationModeGotIP& event){
(void) event;
_restart();
});
_sta_disconnected_handler = WiFi.onStationModeDisconnected([this](const WiFiEventStationModeDisconnected& event) {
(void) event;
_restart();
});
@ -122,6 +124,7 @@ bool LLMNRResponder::_restart() {
_conn->setMulticastTTL(LLMNR_MULTICAST_TTL);
_conn->onRx(std::bind(&LLMNRResponder::_process_packet, this));
_conn->connect(multicast_addr, LLMNR_PORT);
return true;
}
void LLMNRResponder::_process_packet() {
@ -242,8 +245,8 @@ void LLMNRResponder::_process_packet() {
// Header
uint8_t header[] = {
id >> 8, id & 0xff, // ID
FLAGS_QR >> 8, 0, // FLAGS
(uint8_t)(id >> 8), (uint8_t)(id & 0xff), // ID
(uint8_t)(FLAGS_QR >> 8), 0, // FLAGS
0, 1, // QDCOUNT
0, !!have_rr, // ANCOUNT
0, 0, // NSCOUNT
@ -269,7 +272,7 @@ void LLMNRResponder::_process_packet() {
0, 1, // CLASS (IN)
0, 0, 0, 30, // TTL (30 seconds)
0, 4, // RDLENGTH
ip & 0xff, (ip >> 8) & 0xff, (ip >> 16) & 0xff, (ip >> 24) & 0xff, // RDATA
(uint8_t)(ip & 0xff), (uint8_t)((ip >> 8) & 0xff), (uint8_t)((ip >> 16) & 0xff), (uint8_t)((ip >> 24) & 0xff) // RDATA
};
_conn->append(reinterpret_cast<const char*>(rr), sizeof(rr));
}