Re:Rotations with quaternions
by dnautics on Tuesday June 01, 2021 @10:58AM
(#27355348)
am I wrong that this use of a union is UB in C?
[ Parent
| on HN ]
I'm absolutely not a pro in C, so if it is undefined behaviour I'd be glad to know and fix it, I just found out about the notation and it looks handy
checked myself. My cursory, poor search suggests it's UB in C++, but not in C?
Re:Rotations with quaternions
by steerablesafe on Tuesday June 01, 2021 @12:38PM
(#27357261)
It is definitely UB in C++ and probably implementation defined in C (and this use is fine all implementations, AFAIK). Some C++ implementations allow this as a conforming language extension.