Talk:Host introspection: Difference between revisions

Added a note about endianness in Ada
(→‎Perl Program: new section)
(Added a note about endianness in Ada)
 
(2 intermediate revisions by one other user not shown)
Line 1:
== Ada ==
The Ada example provided is technically not correct. The `Bit_Order` attribute does not correspond to ''byte'' endianness, it is a representational attribute used to specify the order of ''bits'' in the layout of a machine scalar in a record representation clause. While this is known as ''bit'' endianness' It has no impact on the byte ordering within a machine scalar. This is described in section '13.5.3 Bit Ordering' of the Ada Reference Manual. The language is a bit ambiguous, but this seems to refer explicitly to bit ordering.
 
== C ==
The C example is not correct: While it is true that on current popular platforms a pointer is as large as a word, this is not universally true. For example in x86 16 bit code using the large memory model a pointer has two words (one for the segment, one for the offset). I'd not be surprised if there are other, more current platforms (especially embedded ones) where pointer size and word size don't agree either.
 
Line 31 ⟶ 35:
 
[[User:GlitchMr|GlitchMr]] 18:55, 24 October 2011 (UTC)
 
: I decided to change the program from $Config{intsize} to $Config{uvsize}, so that the byte order has the same size. ([http://perldoc.perl.org/Config.html perldoc Config] says that $Config{byteorder} is for UV.)
 
: "Word size" has multiple meanings. For an amd64 (x64) processor, some programmers think that a ''word'' is 16 bits, a ''double word'' is 32 bits, and a ''quad word'' is 64 bits. Other programmers think that a ''word'' is 32 bits, like an ''int''. Yet other programmers think that a ''word'' is 64 bits, like a pointer. So $Config{intsize} and $Config{uvsize} are both correct even if they give different sizes. --[[User:Kernigh|Kernigh]] 03:38, 25 October 2011 (UTC)
Anonymous user