Is it safe to assume sizeof(double) >= sizeof(void*)?
Is it safe to assume that sizeof(double) will always be greater than or equal to sizeof(void*) ? To put this in some context, is the following portable? int x = 100; double tmp; union { double dbl; void* ptr; } conv; conv.ptr = (void*)&x; tmp = conv.dbl; conv.dbl = tmp; printf("%d\n", *((int*)conv.ptr)); It does work on the few machines that I've tested it on, but I can see this going horribly wrong if sizeof(void*) > sizeof(double) . On current systems yes. double is 64 bits on all current and future systems because they're aligned with IEEE arithmetic's double-precision. It's unlikely but