From 8524453601903068975
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,738ae3371beb3408
X-Google-Attributes: gidf78e5,public
From: Francis Glassborow <francis@robinton.demon.co.uk>
Subject: Re: portable method of determining endianness byte order.
Date: 1999/12/01
Message-ID: <z6b5yZAtsZR4EwF4@robinton.demon.co.uk>#1/1
X-Deja-AN: 555529286
Approved: stephen.clamage@sun.com (comp.std.c++)
References: <38329967.470B6CED@hqs.mid.gmeds.com> <38359FF5.AB0B77E9@zetec.com> <t73dtnacpa.fsf@calumny.jyacc.com> <g1pNRNAk6GR4Ew21@robinton.demon.co.uk> <823p8g$6gj@library1.airnews.net>
X-UID: 0000000001
X-Status: $$$T
Organization: Southfield Microcomputer SS
Mime-Version: 1.0
Reply-To: Francis Glassborow <francisG@robinton.demon.co.uk>
Newsgroups: comp.std.c++
Originator: clamage@taumet


In article <823p8g$6gj@library1.airnews.net>, Bill Wade
<bill.wade@stoner.com> writes
>Maybe the original poster read read footnote 44 (associated with 3.9.1/7)
>which strongly implies that adjacent bits represent adjacent powers of two.
>It takes some imagination to suppose that two bits in separate bytes can be
>adjacent to each other, if their bytes aren't adjacent to each other.  It
>would seem that the least significant byte of an integer must be at one end,
>and the most significant at the other, with any intermediate bytes in a
>uniform order.  Thus a simple two way choice.
You are confusing logical organisation of bits (as used for shifts etc.)
with the organisation of bytes (which can be detected with techniques
such as unions)  There is nothing that says that adjacent bytes
represent adjacent powers of 256 (512 or whatever else constitutes a
byte on your hardware)

Francis Glassborow      Journal Editor, Association of C & C++ Users
64 Southfield Rd
Oxford OX4 1PA          +44(0)1865 246490
All opinions are mine and do not represent those of any organisation


[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]




