We've (the compiler team) started enforcing that {} initialization can't do narrowing conversions in more places, which means that this code will be broken in a new version of the compiler; this is one method to fix this; the alternative is to compare with 0 in the initialization of a few structure members down-file.
Note that this does not break ABI, due to the following pointer member.
It also works in 32-bit ABIs since the pointer member will have align 4 -- instead of a 7-byte/3-byte alignment member, you'll get a 3-byte/0-byte alignment member, but the size stays the same.
We've (the compiler team) started enforcing that
{}
initialization can't do narrowing conversions in more places, which means that this code will be broken in a new version of the compiler; this is one method to fix this; the alternative is to compare with0
in the initialization of a few structure members down-file.Note that this does not break ABI, due to the following pointer member.
old:
new:
It also works in 32-bit ABIs since the pointer member will have align 4 -- instead of a 7-byte/3-byte alignment member, you'll get a 3-byte/0-byte alignment member, but the size stays the same.