[MPlayer-dev-eng] [PATCH] SuperH fix - vsscanf check shouldn't assume va_list is a pointer type
Bill Traynor
wmat at naoi.ca
Mon Jan 4 21:50:50 CET 2010
Hi,
attached is a patch that changes the snippet of code that tests for the
presence of vsscanf() during configure.
The current test assumes that the type of va_list (as defined by the ABI
of the target we're compiling for) is a pointer type, and therefore that
0 is a valid argument. This is not the case for the SH4 ABI where
va_list happens to be a struct type and even though vsscanf() is
provided by libc the test fails to compile,
/tmp/mplayer-conf-9882-6741.c: In function 'main':
/tmp/mplayer-conf-9882-6741.c:4: error: incompatible type for argument 3 of
'vsscanf'
/home/wmat/CodeSourcery/Sourcery_G++_Lite_4.4-45/bin/../sh-linux-gnu/libc/usr/include/stdio.h:484:
note: expected '__gnuc_va_list' but argument is of type 'int'
The solution is to provide a properly typed argument to vsscanf() so
that it will compile for any ABI.
Index: configure
===================================================================
--- configure (revision 30208)
+++ configure (working copy)
@@ -3745,7 +3745,7 @@
#define _ISOC99_SOURCE
#include <stdarg.h>
#include <stdio.h>
-int main(void) { vsscanf(0, 0, 0); return 0; }
+int main(void) { va_list ap; vsscanf(0, 0, ap); return 0; }
EOF
_vsscanf=no
cc_check && _vsscanf=yes
More information about the MPlayer-dev-eng
mailing list