GNOME Bugzilla – Bug 744034
fdsrc: MinGW Compilation error: unknown conversion type character 'l' in format
Last modified: 2015-02-12 14:56:42 UTC
Created attachment 296184 [details] [review]
I just tried to compile gstreamer core with MSYS2/MinGW (http://sourceforge.net/projects/msys2/) and got a build error in gstfdsrc.c
This is essentially the same as what is described here:
The Glib doc says that "that scanf() may not support 64-bit integers, even if G_GINT64_FORMAT is defined" and suggests "using g_ascii_strtoull() instead"
I attach a patch with which I was able to build gstreamer core, but note that it is not tested yet.
fdsrc is disabled for __MINGW32__ in gstelements.c. If I enable it, the basic launch line given in the source seems to work, but I'm not yet familiar enough with GStreamer to test the uri query
(In reply to Frédéric Wang from comment #0)
> I just tried to compile gstreamer core with MSYS2/MinGW
Correction: I'm actually using mingw-w64 (a fork of mingw) but the issue with scanf still holds: https://sourceforge.net/p/mingw-w64/wiki2/printf%20and%20scanf%20family/
Thanks for the patch, I've pushed it to master with some small changes (kept string constants in code, which is nicer to read; fleshed out error handling a bit more; renamed endptr variable to end so the error handling fits all in one line :)
Author: Frédéric Wang <email@example.com>
Date: Thu Feb 12 14:50:15 2015 +0000
fdsrc: use g_ascii_strtoull() to convert size string in uri
sscanf() doesn't handle G_GUINT64_FORMAT well on mingw64 it
appears, leading to compiler warnings.