At 05:39 9/6/00 +0800, John Summerfield wrote:
> > This sort of thing is inherently a non-portable problem like
> > detecting endianness and other such things. It is unlikely any
>
>Detecting endianness isn't hard to do portably. I did it about 20 years ago,
>in COBOL, when coding for a Honeywell mini. The owners didn't know whether it
>was beg or little..
actually, if I read Mike's statement correctly he isn't saying *HOW*
to do it isn't portable, but *where* it's located (if you follow)
that isn't portable. From an API perspective, what method do you call
to find out the byte ordering? and how is it encoded in the return?
(anyone got the POSIX spec handy?)
>Map an area as int and as char[]. Set it =1 and see where the value's stored.
As Julie already pointed out that misses the most interesting cases.
(and for all of you out there who *only* develop for GNU/Linux/x86, you
have *no idea* how fsck'ing annoying your smart arsed byte manipulations
are until you spend weeks debugging something built on top of that code
that's been ported to (i.e.) GNU/Linux/PPC or AIX/Power or .... *grumble*
yes, I have spent entirely too much time trying to debug something
where some idiot used an unsigned long to hold four distinct bytes....)
_______________________________________________
Redhat-devel-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-devel-list