Skip to content

Commit 3afe9e3

Browse files
Fix deprecated implicit copy ctors in IP code
Fix some warnings present in GCC8/9 in the IPAddress code In AddressListIterator there was a copy constructor which simply copied the structure bit-for-bit. That's the default operation, so remove it to avoid the warning there. IPAddress, add a default copy constructor since the other copy constructors are simply parsing from one format into a native ip_addr_t. @d-a-v, can you give these a look over and see if they're good (since IP stuff is really your domain).
1 parent 726f0e9 commit 3afe9e3

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
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;

0 commit comments

Comments
 (0)