<div class="gmail_quote">On Fri, Dec 2, 2011 at 1:00 PM, Dave Zarzycki <span dir="ltr"><<a href="mailto:zarzycki@apple.com">zarzycki@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div id=":8rc">+        if (sizeof(double) == sizeof(size_t)) {<br>
+            union {<br>
+                double __f;<br>
+                size_t __d;<br>
+            } __u;<br>
+            __u.__f = __v;<br>
+            return __u.__d;</div></blockquote></div><br><div>This still isn't well defined. The way to do this correctly according to the standard is to use 'memcpy' to copy the bytes into your size_t variable and return that. This shouldn't ever result in an actual call to memcpy. If it does on any platform due to insufficient optimizers, we could easily add a call to __builtin_memcpy() (or the equivalent) on those platforms.</div>