Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Endianness of 64 int64_t on 32 bits systems

I would like to know, if the types that are larger than the native machine word, and that have compiler abstraction support, like int64_t on a 32 bits system, have any specification on the byte order in memory ? For example, on little endian machines, should we suppose that the memory layout is a full 64 bits swaped order ? Or it is free to be a middle-endian like the PDP-11 ?

c.f. http://en.wikipedia.org/wiki/Endianness#Middle-endian

Because the __int64 (MS) or long long (gcc) were not standard before int64_t in C99, isn't it far fetched to suppose anything on the byte order of such types ?

Thanks

like image 901
v.oddou Avatar asked Nov 11 '22 19:11

v.oddou


1 Answers

Why would the standard want to specify on the byte order in memory of anything? In all cases this is up to the compier/architecture to freely decide. If you're interested in a specific architecture, just pop up your debugger and watch how a simple program behaves.

like image 196
shoosh Avatar answered Nov 15 '22 05:11

shoosh