After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 744034 - fdsrc: MinGW Compilation error: unknown conversion type character 'l' in format
fdsrc: MinGW Compilation error: unknown conversion type character 'l' in format
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Windows
: Normal normal
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-02-05 11:00 UTC by Frédéric Wang
Modified: 2015-02-12 14:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (808 bytes, patch)
2015-02-05 11:00 UTC, Frédéric Wang
none Details | Review

Description Frédéric Wang 2015-02-05 11:00:51 UTC
Created attachment 296184 [details] [review]
Patch

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:
http://sourceforge.net/p/mingw/bugs/1315/

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"

https://developer.gnome.org/glib/unstable/glib-Basic-Types.html#G-GUINT64-FORMAT:CAPS
https://developer.gnome.org/glib/unstable/glib-String-Utility-Functions.html#g-ascii-strtoull

I attach a patch with which I was able to build gstreamer core, but note that it is not tested yet.
Comment 1 Frédéric Wang 2015-02-05 18:15:24 UTC
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
Comment 2 Frédéric Wang 2015-02-11 09:23:21 UTC
(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/
Comment 3 Tim-Philipp Müller 2015-02-12 14:53:56 UTC
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 :)

commit d7dd0825747abbbda22e8466dd6ba78fa85c0dbe
Author: Frédéric Wang <fred.wang@free.fr>
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.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=744034