[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


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
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; }
 cc_check && _vsscanf=yes

More information about the MPlayer-dev-eng mailing list