Pavel Roskin wrote:
> 
> Hello!
> 
> > ] if test -f conftest.c ; then
> >      if ${CC-cc} conftest.c -o conftest.o && test -f conftest.o ; then
> >         if test `grep -l BIGenDianSyS conftest.o` ; then
> >            echo $ac_n "looks big-endian ... " 1>&AC_FD_MSG
> >            ac_cv_c_bigendian=yes
> >         fi
> >         if test `grep -l LiTTleEnDian conftest.o` ; then
> >            echo $ac_n 'looks little-endian ... ' 1>&AC_FD_MSG
> >            ac_cv_c_bigendian=no
> >         fi
> 
> An what happens if neither is found? What's the default? It should be an
> error.
Correct. I do faintly remember that there had been a test-has-run-ok check,
but it seems to have been lost over the years. The check had just worked
correctly on every platform I had, oh well. Gets fixed...
> 
> What happens if short integers occupy 4 bytes?
Er, actually, I never heard of a platform where that is the case, anyway,
both tests would fail and the test should choke. Can anybody point out
a platfrom where sizeof(short) is 4?

>
> Also I would prefer names containing "ac". However careful you are in
> using unusual capitalization, it is better to show a good example of using
> only Autoconf namespace. My suggestion for the strings: "AC_LITTLEENDIAN"
> and "AC_BIGENDIAN___"
Hmmm.
> 
> By the way, can anybody think of an algorithm that avoids explicit support
> for ASCII and EBCDIC only?
If the target has neither ASCII/EBCDIC, then both tests have a good chance
to fail anyway. As suggested above, the test should choke then. Where could
that happen... hmm... unicode-only host-platform? Anybody seen that? It
seems I am locked to much with the 20 platforms I have around me... ;-)

have fun...
-- Guido

Reply via email to