What's the correct right hand side expression for initializing a storage array of address
?
I'm trying to initialize a storage
address[]
from inside a function. Everything I've tried gives warnings, and I'm looking for the correct way to silence them.
// address[] storage b;
Warning: Uninitialized storage pointer.
This warning is warranted. After testing I've found b
is pointing to "garbage data" which happens to be the same as another address[] storage a
array I define earlier. (Related post) On top of that, modifying b
(b.length = 0
) is modifying the a
array.
Every right hand expression I've tried hasn't worked, since they're meant for memory
arrays. (eg. = address[]()
)