From 52f8c62b81d2e4e0689a4fcf639662665a3577e8 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Sun, 14 Jul 2019 21:22:49 -0700 Subject: [PATCH] Fix GCC 9.1 warnings (except Ticker.h, gdbstub) (#6298) Cleans up all warnings seen w/GCC 9.1 to allow it to track the main branch more easily until 3.x. Does not include Ticker.h "fix" of pragmas around a function cast we're doing that GCC9 doesn't like, that will be addressed separately and maybe only in the 3.0 branch. Does not include GDB hook fix, either, because the pragmas required to disable the GCC9.1 warnings don't exist in 4.8 at all. --- cores/esp8266/AddrList.h | 2 -- cores/esp8266/IPAddress.h | 1 + cores/esp8266/core_esp8266_wiring_digital.cpp | 2 +- cores/esp8266/umm_malloc/umm_malloc_cfg.h | 2 +- libraries/ESP8266SdFat | 2 +- libraries/ESP8266WiFi/src/WiFiClientSecureAxTLS.cpp | 6 +++--- libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.h | 2 ++ libraries/ESP8266WiFi/src/WiFiServerSecureBearSSL.h | 2 ++ libraries/GDBStub/src/internal/gdbstub.c | 4 ++-- tools/sdk/ld/eagle.app.v6.common.ld.h | 2 ++ tools/sdk/libc/xtensa-lx106-elf/include/sys/reent.h | 2 +- 11 files changed, 16 insertions(+), 11 deletions(-) diff --git a/cores/esp8266/AddrList.h b/cores/esp8266/AddrList.h index 36ccd49b3..23a105f25 100644 --- a/cores/esp8266/AddrList.h +++ b/cores/esp8266/AddrList.h @@ -167,8 +167,6 @@ public: bool operator== (AddressListIterator& o) { return netIf.equal(*o); } bool operator!= (AddressListIterator& o) { return !netIf.equal(*o); } - AddressListIterator& operator= (const AddressListIterator& o) { netIf = o.netIf; return *this; } - AddressListIterator operator++ (int) { AddressListIterator ret = *this; diff --git a/cores/esp8266/IPAddress.h b/cores/esp8266/IPAddress.h index f78b02278..bf5ef1010 100644 --- a/cores/esp8266/IPAddress.h +++ b/cores/esp8266/IPAddress.h @@ -136,6 +136,7 @@ class IPAddress: public Printable { // Overloaded copy operators to allow initialisation of IPAddress objects from other types IPAddress& operator=(const uint8_t *address); IPAddress& operator=(uint32_t address); + IPAddress& operator=(const IPAddress&) = default; virtual size_t printTo(Print& p) const; String toString() const; diff --git a/cores/esp8266/core_esp8266_wiring_digital.cpp b/cores/esp8266/core_esp8266_wiring_digital.cpp index a1a0d51ff..5ed0a40ab 100644 --- a/cores/esp8266/core_esp8266_wiring_digital.cpp +++ b/cores/esp8266/core_esp8266_wiring_digital.cpp @@ -252,7 +252,7 @@ extern void initPins() { extern void pinMode(uint8_t pin, uint8_t mode) __attribute__ ((weak, alias("__pinMode"))); extern void digitalWrite(uint8_t pin, uint8_t val) __attribute__ ((weak, alias("__digitalWrite"))); -extern int digitalRead(uint8_t pin) __attribute__ ((weak, alias("__digitalRead"))); +extern int digitalRead(uint8_t pin) __attribute__ ((weak, alias("__digitalRead"), nothrow)); extern void attachInterrupt(uint8_t pin, voidFuncPtr handler, int mode) __attribute__ ((weak, alias("__attachInterrupt"))); extern void attachInterruptArg(uint8_t pin, voidFuncPtrArg handler, void* arg, int mode) __attribute__((weak, alias("__attachInterruptArg"))); extern void detachInterrupt(uint8_t pin) __attribute__ ((weak, alias("__detachInterrupt"))); diff --git a/cores/esp8266/umm_malloc/umm_malloc_cfg.h b/cores/esp8266/umm_malloc/umm_malloc_cfg.h index e7c573c87..14fb4a8e4 100644 --- a/cores/esp8266/umm_malloc/umm_malloc_cfg.h +++ b/cores/esp8266/umm_malloc/umm_malloc_cfg.h @@ -91,7 +91,7 @@ void* realloc_loc (void* p, size_t s, const char* file, int line); #define UMM_BEST_FIT /* Start addresses and the size of the heap */ -extern char _heap_start; +extern char _heap_start[]; #define UMM_MALLOC_CFG__HEAP_ADDR ((uint32_t)&_heap_start) #define UMM_MALLOC_CFG__HEAP_SIZE ((size_t)(0x3fffc000 - UMM_MALLOC_CFG__HEAP_ADDR)) diff --git a/libraries/ESP8266SdFat b/libraries/ESP8266SdFat index 6326c71ff..05fd2c86a 160000 --- a/libraries/ESP8266SdFat +++ b/libraries/ESP8266SdFat @@ -1 +1 @@ -Subproject commit 6326c71ff1f6294756b6e348edaf723bfe7be3e7 +Subproject commit 05fd2c86ad6493e99821cbd06a66fc05c5325ba8 diff --git a/libraries/ESP8266WiFi/src/WiFiClientSecureAxTLS.cpp b/libraries/ESP8266WiFi/src/WiFiClientSecureAxTLS.cpp index b47d7c21e..62b7f0ab8 100644 --- a/libraries/ESP8266WiFi/src/WiFiClientSecureAxTLS.cpp +++ b/libraries/ESP8266WiFi/src/WiFiClientSecureAxTLS.cpp @@ -473,7 +473,7 @@ extern "C" int __ax_port_read(int fd, uint8_t* buffer, size_t count) } return cb; } -extern "C" void ax_port_read() __attribute__ ((weak, alias("__ax_port_read"))); +extern "C" int ax_port_read(int fd, uint8_t* buffer, size_t count) __attribute__ ((weak, alias("__ax_port_read"))); extern "C" int __ax_port_write(int fd, uint8_t* buffer, size_t count) { @@ -489,7 +489,7 @@ extern "C" int __ax_port_write(int fd, uint8_t* buffer, size_t count) } return cb; } -extern "C" void ax_port_write() __attribute__ ((weak, alias("__ax_port_write"))); +extern "C" int ax_port_write(int fd, uint8_t* buffer, size_t count) __attribute__ ((weak, alias("__ax_port_write"))); extern "C" int __ax_get_file(const char *filename, uint8_t **buf) { @@ -497,7 +497,7 @@ extern "C" int __ax_get_file(const char *filename, uint8_t **buf) *buf = 0; return 0; } -extern "C" void ax_get_file() __attribute__ ((weak, alias("__ax_get_file"))); +extern "C" int ax_get_file(const char *filename, uint8_t **buf) __attribute__ ((weak, alias("__ax_get_file"))); extern "C" void __ax_wdt_feed() { diff --git a/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.h b/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.h index 54d47616e..c3622aec0 100644 --- a/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.h +++ b/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.h @@ -37,6 +37,8 @@ class WiFiClientSecure : public WiFiClient { WiFiClientSecure(const WiFiClientSecure &rhs); ~WiFiClientSecure() override; + WiFiClientSecure& operator=(const WiFiClientSecure&) = default; // The shared-ptrs handle themselves automatically + int connect(IPAddress ip, uint16_t port) override; int connect(const String& host, uint16_t port) override; int connect(const char* name, uint16_t port) override; diff --git a/libraries/ESP8266WiFi/src/WiFiServerSecureBearSSL.h b/libraries/ESP8266WiFi/src/WiFiServerSecureBearSSL.h index 07142c7a4..d735c0cae 100644 --- a/libraries/ESP8266WiFi/src/WiFiServerSecureBearSSL.h +++ b/libraries/ESP8266WiFi/src/WiFiServerSecureBearSSL.h @@ -62,6 +62,8 @@ class WiFiServerSecure : public WiFiServer { void setServerKeyAndCert(const uint8_t *key, int keyLen, const uint8_t *cert, int certLen); void setServerKeyAndCert_P(const uint8_t *key, int keyLen, const uint8_t *cert, int certLen); + WiFiServerSecure& operator=(const WiFiServerSecure&) = default; + using ClientType = WiFiClientSecure; private: diff --git a/libraries/GDBStub/src/internal/gdbstub.c b/libraries/GDBStub/src/internal/gdbstub.c index cd707d278..860345e20 100644 --- a/libraries/GDBStub/src/internal/gdbstub.c +++ b/libraries/GDBStub/src/internal/gdbstub.c @@ -900,7 +900,7 @@ void ATTR_GDBINIT gdbstub_set_uart_isr_callback(void (*func)(void*, uint8_t), vo //gdbstub initialization routine. -void ATTR_GDBINIT gdbstub_init() { +void gdbstub_init() { #if GDBSTUB_REDIRECT_CONSOLE_OUTPUT os_install_putc1(gdbstub_semihost_putchar1); #endif @@ -923,4 +923,4 @@ bool ATTR_GDBEXTERNFN gdb_present() { } void ATTR_GDBFN gdb_do_break() { gdbstub_do_break(); } -void ATTR_GDBINIT gdb_init() __attribute__((alias("gdbstub_init"))); +void gdb_init() __attribute__((alias("gdbstub_init"))); diff --git a/tools/sdk/ld/eagle.app.v6.common.ld.h b/tools/sdk/ld/eagle.app.v6.common.ld.h index 45aafed69..2f5735fff 100644 --- a/tools/sdk/ld/eagle.app.v6.common.ld.h +++ b/tools/sdk/ld/eagle.app.v6.common.ld.h @@ -129,6 +129,8 @@ SECTIONS *(.text.app_entry*) /* The main startup code */ + *(.text.gdbstub*, .text.gdb_init) /* Any GDB hooks */ + /* all functional callers are placed in IRAM (including SPI/IRQ callbacks/etc) here */ *(.text._ZNKSt8functionIF*EE*) /* std::function::operator()() const */ } >iram1_0_seg :iram1_0_phdr diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/reent.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/reent.h index ce5b3eda7..37ab5b6e8 100644 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/reent.h +++ b/tools/sdk/libc/xtensa-lx106-elf/include/sys/reent.h @@ -402,7 +402,7 @@ struct _reent char *_asctime_buf; /* signal info */ - void (**(_sig_func))(int); + void (**_sig_func)(int); # ifndef _REENT_GLOBAL_ATEXIT /* atexit stuff */