Updated Arduino Studio gives new errors (ESP8266 chip using WebServer/Client)

Im trying to compile an old sketch that used to compile fine and work out what has changed to cause problems. There are quite a lot of errors in the code so Im trying to get started on some things that I thought would be easy, and Im still struggling...!

The code below generates an error about ambiguous conversion from IPAddress to byte array - "conversion from 'IPAddress' to 'byte {aka unsigned char}' is ambiguous"

This error prevents compiling but never used to, despite casting to (byte) I cant seem to stop the error

byte current_add[4] = {server->client().remoteIP()};

I could fix this by converting each of the bytes individually and taking a few extra lines of code, but Im more curious about my understanding.

Please can somebody help with my understand of why this is ambiguous? (I cant think of a situation where it would be ambiguous). And ideally a good practice solution for solving it.

Thank you so much in advance

use const byte current_add[4]

Ahh, so now I see why it could be seen as ambiguous, since I assume it doesnt know when the IP address might change, and hence if the data is correct at what part in code compilation/runtime/....etc.

However, having added the const flag I am still finding it gives the same error message....

EDIT: From some further trial and error I have discovered that it just doesn't like initialising the byte array with a single object remoteIP() - even though that object is effectively a byte array. I wonder why this has stopped working when it has worked fine for a couple of years?

cjcharles: Ahh, so now I see why it could be seen as ambiguous, since I assume it doesnt know when the IP address might change, and hence if the data is correct at what part in code compilation/runtime/....etc.

However, having added the const flag I am still finding it gives the same error message....

EDIT: From some further trial and error I have discovered that it just doesn't like initialising the byte array with a single object remoteIP() - even though that object is effectively a byte array. I wonder why this has stopped working when it has worked fine for a couple of years?

they added IPv6 support

Juraj: they added IPv6 support

Makes perfect sense! Thank you! Now it all makes sense!