
6 Jun
2014
6 Jun
'14
10:28 p.m.
Emil Dotchevski wrote:
You need a cast, and my understanding is that that makes your code not portable because it violates the strict aliasing rule.
For float v[4][4], &v[0][0] is not a cast and gives you a float* p such that the elements are in [p+0, p+16). A reinterpret_cast to float(&)[16] is an interesting theoretical question. I think that it doesn't violate the aliasing rules, but g++ is in the habit of disagreeing with such statements.