Skip to content

Commit 52f8c62

Browse files
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.
1 parent c18b402 commit 52f8c62

File tree

11 files changed

+16
-11
lines changed

11 files changed

+16
-11
lines changed

cores/esp8266/AddrList.h

-2
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,6 @@ class AddressListIterator
167167
bool operator== (AddressListIterator& o) { return netIf.equal(*o); }
168168
bool operator!= (AddressListIterator& o) { return !netIf.equal(*o); }
169169

170-
AddressListIterator& operator= (const AddressListIterator& o) { netIf = o.netIf; return *this; }
171-
172170
AddressListIterator operator++ (int)
173171
{
174172
AddressListIterator ret = *this;

cores/esp8266/IPAddress.h

+1
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ class IPAddress: public Printable {
136136
// Overloaded copy operators to allow initialisation of IPAddress objects from other types
137137
IPAddress& operator=(const uint8_t *address);
138138
IPAddress& operator=(uint32_t address);
139+
IPAddress& operator=(const IPAddress&) = default;
139140

140141
virtual size_t printTo(Print& p) const;
141142
String toString() const;

cores/esp8266/core_esp8266_wiring_digital.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ extern void initPins() {
252252

253253
extern void pinMode(uint8_t pin, uint8_t mode) __attribute__ ((weak, alias("__pinMode")));
254254
extern void digitalWrite(uint8_t pin, uint8_t val) __attribute__ ((weak, alias("__digitalWrite")));
255-
extern int digitalRead(uint8_t pin) __attribute__ ((weak, alias("__digitalRead")));
255+
extern int digitalRead(uint8_t pin) __attribute__ ((weak, alias("__digitalRead"), nothrow));
256256
extern void attachInterrupt(uint8_t pin, voidFuncPtr handler, int mode) __attribute__ ((weak, alias("__attachInterrupt")));
257257
extern void attachInterruptArg(uint8_t pin, voidFuncPtrArg handler, void* arg, int mode) __attribute__((weak, alias("__attachInterruptArg")));
258258
extern void detachInterrupt(uint8_t pin) __attribute__ ((weak, alias("__detachInterrupt")));

cores/esp8266/umm_malloc/umm_malloc_cfg.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void* realloc_loc (void* p, size_t s, const char* file, int line);
9191
#define UMM_BEST_FIT
9292

9393
/* Start addresses and the size of the heap */
94-
extern char _heap_start;
94+
extern char _heap_start[];
9595
#define UMM_MALLOC_CFG__HEAP_ADDR ((uint32_t)&_heap_start)
9696
#define UMM_MALLOC_CFG__HEAP_SIZE ((size_t)(0x3fffc000 - UMM_MALLOC_CFG__HEAP_ADDR))
9797

libraries/ESP8266WiFi/src/WiFiClientSecureAxTLS.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ extern "C" int __ax_port_read(int fd, uint8_t* buffer, size_t count)
473473
}
474474
return cb;
475475
}
476-
extern "C" void ax_port_read() __attribute__ ((weak, alias("__ax_port_read")));
476+
extern "C" int ax_port_read(int fd, uint8_t* buffer, size_t count) __attribute__ ((weak, alias("__ax_port_read")));
477477

478478
extern "C" int __ax_port_write(int fd, uint8_t* buffer, size_t count)
479479
{
@@ -489,15 +489,15 @@ extern "C" int __ax_port_write(int fd, uint8_t* buffer, size_t count)
489489
}
490490
return cb;
491491
}
492-
extern "C" void ax_port_write() __attribute__ ((weak, alias("__ax_port_write")));
492+
extern "C" int ax_port_write(int fd, uint8_t* buffer, size_t count) __attribute__ ((weak, alias("__ax_port_write")));
493493

494494
extern "C" int __ax_get_file(const char *filename, uint8_t **buf)
495495
{
496496
(void) filename;
497497
*buf = 0;
498498
return 0;
499499
}
500-
extern "C" void ax_get_file() __attribute__ ((weak, alias("__ax_get_file")));
500+
extern "C" int ax_get_file(const char *filename, uint8_t **buf) __attribute__ ((weak, alias("__ax_get_file")));
501501

502502
extern "C" void __ax_wdt_feed()
503503
{

libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.h

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ class WiFiClientSecure : public WiFiClient {
3737
WiFiClientSecure(const WiFiClientSecure &rhs);
3838
~WiFiClientSecure() override;
3939

40+
WiFiClientSecure& operator=(const WiFiClientSecure&) = default; // The shared-ptrs handle themselves automatically
41+
4042
int connect(IPAddress ip, uint16_t port) override;
4143
int connect(const String& host, uint16_t port) override;
4244
int connect(const char* name, uint16_t port) override;

libraries/ESP8266WiFi/src/WiFiServerSecureBearSSL.h

+2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ class WiFiServerSecure : public WiFiServer {
6262
void setServerKeyAndCert(const uint8_t *key, int keyLen, const uint8_t *cert, int certLen);
6363
void setServerKeyAndCert_P(const uint8_t *key, int keyLen, const uint8_t *cert, int certLen);
6464

65+
WiFiServerSecure& operator=(const WiFiServerSecure&) = default;
66+
6567
using ClientType = WiFiClientSecure;
6668

6769
private:

libraries/GDBStub/src/internal/gdbstub.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ void ATTR_GDBINIT gdbstub_set_uart_isr_callback(void (*func)(void*, uint8_t), vo
900900

901901

902902
//gdbstub initialization routine.
903-
void ATTR_GDBINIT gdbstub_init() {
903+
void gdbstub_init() {
904904
#if GDBSTUB_REDIRECT_CONSOLE_OUTPUT
905905
os_install_putc1(gdbstub_semihost_putchar1);
906906
#endif
@@ -923,4 +923,4 @@ bool ATTR_GDBEXTERNFN gdb_present() {
923923
}
924924

925925
void ATTR_GDBFN gdb_do_break() { gdbstub_do_break(); }
926-
void ATTR_GDBINIT gdb_init() __attribute__((alias("gdbstub_init")));
926+
void gdb_init() __attribute__((alias("gdbstub_init")));

tools/sdk/ld/eagle.app.v6.common.ld.h

+2
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ SECTIONS
129129

130130
*(.text.app_entry*) /* The main startup code */
131131

132+
*(.text.gdbstub*, .text.gdb_init) /* Any GDB hooks */
133+
132134
/* all functional callers are placed in IRAM (including SPI/IRQ callbacks/etc) here */
133135
*(.text._ZNKSt8functionIF*EE*) /* std::function<any(...)>::operator()() const */
134136
} >iram1_0_seg :iram1_0_phdr

tools/sdk/libc/xtensa-lx106-elf/include/sys/reent.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ struct _reent
402402
char *_asctime_buf;
403403

404404
/* signal info */
405-
void (**(_sig_func))(int);
405+
void (**_sig_func)(int);
406406

407407
# ifndef _REENT_GLOBAL_ATEXIT
408408
/* atexit stuff */

0 commit comments

Comments
 (0)