I get the same thing on my Sparc, but if I modify your code:<br><br>int main( void )<br>{<br>#ifndef __FLOAT_WORD_ORDER<br> printf( "Q3 has no clue!\n" );<br> return 0;<br>#endif<br><br> printf( "Q3 thinks this machine is " );
<br><br>#if __FLOAT_WORD_ORDER == __LITTLE_ENDIAN<br> printf( "little endian\n" );<br>#else<br> printf( "big endian\n" );<br>#endif<br><br> return 0;<br>}<br><br><br>I get:<br><br>bacardi:/tmp> ./a.out
<br>Q3 has no clue!<br><br>I just checked a couple other architectures (ai32, Alpha, Power4), and I can't find __FLOAT_WORD_ORDER or __LITTLE_ENDIAN defined on any machine. This is why the test chooses little--because they are both undefined therefore equal one another. Perhaps a more generic #define should be used in the code, and the appropriate value be set for each arch in the Makefile.
<br><br>I guess I was lucky when building on my Alpha as it is little endian.<br><br><br><div><span class="gmail_quote">On 11/1/05, <b class="gmail_sendername">
<a href="mailto:vincent@cojot.name" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">vincent@cojot.name</a></b> <<a href="mailto:vincent@cojot.name" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
vincent@cojot.name</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>You know, This PPC problem made me realize something as Solaris/Sparc<br>suffers from the same symptoms as PPC (no VM_compiled, using interpreter<br>and then a sig 10 or sig 11).<br><br>When running q3_endian_test on Solaris/Sparc it resulted in:
<br><br>raistlin@ergoth:[/net/thorbardin/export/home/raistlin ]cat q3_endian.c<br>#include <assert.h><br>#include <math.h><br>#include <stdio.h><br>#include <stdarg.h><br>#include <string.h>
<br>
#include <stdlib.h><br>#include <time.h><br>#include <ctype.h><br>#include <limits.h><br>#include <stdio.h><br><br>int main( void )<br>{<br> printf( "Q3 thinks this machine is " );
<br><br>#if __FLOAT_WORD_ORDER == __LITTLE_ENDIAN<br> printf( "little endian\n" );<br>#else<br> printf( "big endian\n" );<br>#endif<br><br> return 0;<br>}<br><br>raistlin@ergoth:[/net/thorbardin/export/home/raistlin ]./q3_endian
<br>Q3 thinks this machine is little endian<br><br>Obviously this is wrong for Solaris/Sparc and __FLOAT_WORD_ORDER is<br>nowhere to be defined anyway.. I'll be checking the #ifdef in the VM<br>stuff..<br><br>Vincent<br>
</blockquote>
</div><br><br clear="all"><br>-- <br>Chad Gatesman<br><a href="http://gatesman.dyndns.org/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://gatesman.dyndns.org/</a>