Skip to content

Commit

Permalink
Fix deprecated implicit copy ctors in IP code
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
earlephilhower committed Jul 13, 2019
1 parent 726f0e9 commit 3afe9e3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 0 additions & 2 deletions cores/esp8266/AddrList.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,6 @@ class AddressListIterator
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;
Expand Down
1 change: 1 addition & 0 deletions cores/esp8266/IPAddress.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3afe9e3

Please sign in to comment.