by wireprotocol · 6y ago · 0 comments
Technically, you are supposed to use unions for that, though it's a pain. The PostgreSQL codebase is compile with -fno-strict-aliasing so that a simple cast will get the job done, but obviously that's technically out of spec.
1: http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_257.htm
2: http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_283.htm