Y
Hacker News
new
|
ask
|
show
|
jobs
by
oynqr
1684 days ago
The minimum size for unsigned long is 4 bytes
1 comments
dataflow
1684 days ago
Oh I didn't realize its size varies on x86 and x64... I thought it's always 64-bit under compilers that target Linux! Today I learned...
link
tomsmeding
1684 days ago
There is a difference between 'long' and 'long long'. I believe the latter
is
always 64 bits on Linux.
link
dataflow
1684 days ago
I'm indeed aware of that one :-)
link
jamesfinlayson
1684 days ago
I think the size can vary by compiler rather than just by architecture.
link
dataflow
1684 days ago
Yeah it can but in practice systems have a canonical model in their official headers.
link
gpderetta
1684 days ago
And yet msvc and gcc disagree on sizeof(long) on AMD64.
Edit: but of course you meant OS with system, not hardware architecture :)
link
dataflow
1684 days ago
MSVC on...
Linux
AMD64?
link
gpderetta
1684 days ago
:) to be fair I did note my misunderstanding in my edit.
link