On an architecture where sizeof(long)==8, I would think that neither solution would work.
I think (or actually, I'm pretty sure, because on my system, sizeof(long)==8) the pack/unpack solution would work, because pack "l" always (by definiton) is 32-bit, independent of what long might be on the system/C compiler, otherwise.
In reply to Re^4: Integer overflow
by almut
in thread Integer overflow
by terranullis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |