New version = too much false warnings

After update to 8.2.88.1835 I got many false warnings. For example:

int _int;
data.getBytes(&_int) range(NSMakeRange(start, sizeof(int)));

int _int = warning: may not be initialized. It not need to be initialized, because getBytes with size sizeof(int) will always write any value to _int.

Same here. How to initialize struct? I zeroing it, so it’s initialized :slight_smile:

__struct_sockaddr_in zeroAddress;
bzero(&zeroAddress, sizeof(__struct_sockaddr_in));

It’s not a bug, but too much warning strings in output window. I like to see all warnings, but real one.

b.r.

Thanks, logged as bugs://73034

So really the compiler was wrong to not warn on this before on Nougat (it always did on Echoes and Cooper). I’m going to change it though, so it doesn’t warn on pointer parameters like that. Note that you can use default to initialize a local to it’s default value:

__struct_sockaddr_in zeroAddress = default(__struct_sockaddr_in);

bugs://73034 got closed with status fixed.

Great info. Thanks :slight_smile: :+1:

b.r.