fails to (cross-)build for Windows
Submitted by Simon McVittie
Link to original bug (#692699)
Description
While cross-building GLib using Debian wheezy's mingw-w64 toolchain to confirm that my patch for Bug #692583 wasn't a regression on Windows, GLib compiled OK (with warnings), but GIO failed.
GIO (errors; there might be more, I didn't make -k):
/home/smcv/src/gnome/glib/gio/glocalfile.c: In function 'is_remote_fs': /home/smcv/src/gnome/glib/gio/glocalfile.c:2431:7: error: 'statfs_result' undeclared (first use in this function) /home/smcv/src/gnome/glib/gio/glocalfile.c:2431:7: note: each undeclared identifier is reported only once for each function it appears in /home/smcv/src/gnome/glib/gio/glocalfile.c: In function 'is_remote': /home/smcv/src/gnome/glib/gio/glocalfile.c:2464:3: error: implicit declaration of function 'path_has_prefix' [-Werror=implicit-function-declaration] cc1: some warnings being treated as errors
The broken cases here are:
statfs_result: !defined (USE_STATFS) && defined (USE_STATVFS)
path_has_prefix(): defined (G_OS_WIN32)
GLib (warnings):
/home/smcv/src/gnome/glib/glib/gstdio.c: In function 'g_stat': /home/smcv/src/gnome/glib/glib/gstdio.c:496:3: warning: passing argument 2 of '_wstat' from incompatible pointer type [enabled by default] /usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/sys/stat.h:126:66: note: expected 'struct _stat *' but argument is of type 'struct GStatBuf *' /home/smcv/src/gnome/glib/glib/gmain.c: In function 'g_main_context_iterate.isra.11': /home/smcv/src/gnome/glib/glib/gmain.c:4008:20: warning: 'poll_timer' may be used uninitialized in this function [-Wuninitialized] /home/smcv/src/gnome/glib/glib/gmain.c:3966:11: note: 'poll_timer' was declared here /home/smcv/src/gnome/glib/glib/gutils.c: In function 'g_win32_get_system_data_dirs_for_module': /home/smcv/src/gnome/glib/glib/gutils.c:1952:22: warning: 'hmodule' may be used uninitialized in this function [-Wuninitialized] /home/smcv/src/gnome/glib/glib/gutils.c:1867:11: note: 'hmodule' was declared here In file included from /home/smcv/src/gnome/glib/glib/gconvert.c:35:0: /home/smcv/src/gnome/glib/glib/win_iconv.c: In function 'utf32_mbtowc': /home/smcv/src/gnome/glib/glib/win_iconv.c:1540:52: warning: 'wc' may be used uninitialized in this function [-Wuninitialized]
struct _stat * vs. struct GStatBuf * might not be a real problem, I don't know the intricacies of Windows _wstat.
poll_timer, hmodule and wc might be false positives (this isn't a very recent gcc, it might have wrong heuristics), or might be serious.
Version: 2.35.x