On 64-bit architectures, long int
, according to gcc is at least an int64_t
. On 32-bit, long int
is at least int32_t
. With Microsoft compilers, long
is always an int32_t
, regardless of 32/64-bit. Is there any way to:
int is 4 bytes in all three OSes on Intel.
Long signed integer type. Capable of containing at least the [−2,147,483,647, +2,147,483,647] range.
int is 32 bits in size. long , ptr , and off_t are all 64 bits (8 bytes) in size. The 32-bit data model for z/OS® XL C/C++ compilers is ILP32 plus long long.
Don't do this - use standard types such as int32_t
, uint32_t
, int64_t
, uint64_t
, etc from <stdint.h>
rather than trying to make assumptions about naked types such as long int
or trying to bend the compiler to your will.
Note: The 64-bit model for any given platform (e.g. LP64 for most *nix platforms, Mac OS X, etc) is a given, so even if you could convince the compiler to use a different 64-bit model you would probably break any calls to system code, libraries, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With