[MPlayer-dev-eng] [PATCH] configure: avoid warning in endian testing

Giorgio mywing81 at gmail.com
Wed Sep 15 12:10:33 CEST 2010


>> --- configure (revision 32238)
>> +++ configure (working copy)
>> @@ -2441,7 +2441,7 @@
>>    cat > $TMPC <<EOF
>>  short ascii_name[] = { (('M'<<8)|'P'),(('l'<<8)|'a'),(('y'<<8)|'e'),(('r'<<8)|'B'),
>>                         (('i'<<8)|'g'),(('E'<<8)|'n'),(('d'<<8)|'i'),(('a'<<8)|'n'),0};
>> -int main(void) { return (int)ascii_name; }
>> +int main(void) { return ascii_name[0]; }
>
> Just casting to long will avoid the warning as well.  I tested it to
> work as expected on x86_32, x86_64 and PPC.

Yes, I had tried that too and it actually silenced the warning, since
on my system sizeof(long int) = sizeof(short int *). If it works well
on other platforms, then it's probably the best solution.

> Thanks for the patch, I'm currently working on purging warnings
> from configure checks...

I've noticed! Keep up the good work :)

Giorgio Vazzana


More information about the MPlayer-dev-eng mailing list