[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: calling all ports: what is your endianness?



also sprach Daniel Burrows <Daniel_Burrows@brown.edu> [2002.01.22.0132 +0100]:
>   Shouldn't this be a configure test?  I'd imagine that just stuffing
> several bytes into an array and then testing the result as a word would
> be sufficient.

moreover, a PowerPC can be run big or little endian. this *should* be a
dynamic test, which is so trivial to write...

cat << EOF > is_big_endian.c
int main(void)
{
  long l = 0xFF000000;
  unsigned char *c = &l;
  return (*c != 0xFF);
}
EOF
gcc -w -o is_big_endian is_big_endian.c
./is_big_endian && echo "i am big endian."

-- 
martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:"; net@madduck
  
no cat has eight tails.
a cat has one tail more than no cat.
therefore, a cat has nine tails.

Attachment: pgpomnz73kpiE.pgp
Description: PGP signature


Reply to: