Re: Little/Big endian discussion (was: Re: can I burn the output of mpg123 -s?)
On Wed, 19 Aug 1998, Stephen A. Witt wrote:
[ snip network vs. host order discussion ]
[ I wrote ]
: > I'm coming into this late, and perhaps under-armed ... but no, I don't
: > understand. Network order == big-endian ... so on little-endian
: > machines htons(), htonl() et. do actually perform a conversion. On a
: > big-endian system, no conversion is necessary because network order ==
: > host order on these machines.
[ Steve wrote ]
: wrong. The htons(), htonl(), etc. routines should ALWAYS be used
: regardless of whether they are needed (little endian) or not (big endian).
: This is just good software engineering practice. Anyone making this kind
: of mistake will not be looked upon favorably by the other members of their
: software development team are will likely receive a sharp retort.
Bummer; as I re-read my email I see that I didn't express myself well at
all. I agree that systems exchanging information should always use the
routines in question (even though I didn't explicitly state that) ... my
point about "no conversion necessary" was in response to Steve
Carpenter's assertion that the functions "did nothing" on big-endian
machines. Even though the functions do nothing, they should still be
used for portability.
Sorry about that!
--
Nathan Norman
MidcoNet 410 South Phillips Avenue Sioux Falls, SD
mailto:finn@midco.net http://www.midco.net
finger finn@home.midco.net for PGP Key: (0xA33B86E9)
Reply to: