[Box Backup] Endian bug in rc2 and trunk...

Alex Harper boxbackup@fluffy.co.uk
Fri, 08 Feb 2008 08:00:46 -0800


Hi Ben,

> Care has been taken to make endian issues automatically taken care
> of, for example, the autogenerated Protocol classes do it for you.

I'm glad to hear that endianess was so carefully considered, and thus
reassured I went back and double-checked my own work.

The good news is that it all appears to be my fault :)

I have CFLAGS=3D"-arch i386 -arch ppc" and similar LDFLAGS defined in my
environment by default, so that I build OS X "universal" binaries of variou=
s
libraries I use for my own development. Unfortunately this apparently trick=
s
Box Backup's configure into undef'ing WORDS_BIGENDIAN for both
architectures.=20

Running configure separately for each architecture gets WORDS_BIGENDIAN
right and the resulting binaries appear to interoperate.

I'm very sorry for the false alarm.

Might I suggest that the endian logic at Box.h:140 test the gcc preprocesso=
r
magic __BIG_ENDIAN__ and __LITTLE_ENDIAN__ before falling back to trusting
WORDS_BIGENDIAN? These are more likely to be definitive.

Again, sorry for the false alarm,

Alex

--
Alex Harper                                         aharper@foobox.net

=B3We cross our bridges when we come to them and burn them behind us, with
nothing to show for our progress except a memory of the smell of smoke,
and a presumption that once our eyes watered.=B2   - Tom Stoppard