Implicit cast from array to vector pointer changes alignment requirement
Not a bug, but:
fn void test(float[<4>]* out) {
*out *= 2;
}
fn int main(String[] args) {
float[4] v;
test(&v); // This implicitly changes the alignment requirement of v
}
Yes. I'm not sure whether this is wrong though.
This can go completely unnoticed, in fact it almost did for me, especially when the alignment just happens to match up. Then one day it just crashes and you're left wondering why. I'm generally not that worried about footguns, but man, you've got to tighten up some of these implicit conversions. I don't even understand what the benefit of this is, saving a few characters needed to type for an explicit cast?
Indeed. Since the opposite is fine too.
Master is updated.
Please check that it's working correctly for this and other similar pointer conversions.
Is this working?
Yes this works well, thank you.