libsoup fails to compile with error unknown conversion type character 'h' in format
I was trying to build all packages flac depends on, and libsoup (depended on by gst-plugins-good) fails with the attached log.
I've tried various combinations of -std=c99 or defining __USE_MINGW_ANSI_STDIO=1, but nothing seems to have an effect.
That didn't seem to fix it - I still get the same error.
@mabrand not sure if you got a notication for the comment, so hopefully this will trigger one if the comment didn't.
The same error occurs.
I'm also realising below is just a test, so of course my attempts to remove ansi or add __USE_MINGW_ANSI_STDIO there wouldn't have any effect.
It seems to build fine with gcc 15, but the build fails for me too with the default gcc 11.5. I don't have a good explanation for this or know how to fix it, but a solution for you might be to use MXE_PLUGIN_DIRS=plugins/gcc15. Of course, if someone can figure out how to fix the build with gcc 11.5, that would be great.
I see, that's strange. That's a neat way to use a different compiler version - at first I started mucking around with gcc.mk.
I'll first try to be able to build it with gcc 15.2. Then see what's going wrong, where. If only gcc didn't so long to compile ...
Edit: I'll first see with which gcc version it starts working. gcc 15 definitely works - Also small sidenote - libsndfile doesn't compile with gcc 15 :D
Could you reopen the issue? I can't reopen it.
It works with gcc14. So the change is between gcc13 and 14.
libsndfile doesn't compile with gcc 15 :D
2ffe7bb05ce08a036cc1e39bdd6962e19e0f6321 seems to fix it
I found a likely culprit why it now compiles btw:
https://github.com/gcc-mirror/gcc/commit/966f3c134bb4802ac7ba0517de4e8e3f6384cfa3
ah okay, so this put me on the correct track.
-Dc_std=gnu89 \
+ -Dc_args='-D__USE_MINGW_ANSI_STDIO=0' \
fixes it - and is likely more correct, because mxe doesn't use ucrt - so the warning would actually be correct and is wrongly silenced?
Although it seems libsoup intentionally added this:
https://github.com/GNOME/libsoup/commit/050f8e29745ac7fe4238820c7a35e803668674ad
I'm not sure what's correct to do here. Either patch gcc or maybe patch this in meson.build in libsoup - or just add it to libsoup.mk.
Right, so after looking at gcc building.
__USE_MINGW_ANSI_STDIO=0 is intentionally added by mingw64 for gcc.
So libsoup just needs to use __USE_MINGW_ANSI_STDIO=0 as well.
Adding it to libsoup.mk adds a warning for each compiled file, because __USE_MINGW_ANSI_STDIO=1 is added in meson.build.
So either add it to libsoup.mk
or patch this out in libsoups meson.build:
if cc.get_id() != 'msvc' and host_system == 'windows'
# For "%2hhx" sscanf format and the like
add_project_arguments('-D__USE_MINGW_ANSI_STDIO=1', language : 'c')
endif