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 754307 - size of array '_GStaticAssertCompileTimeAssertion_3387' is negative
size of array '_GStaticAssertCompileTimeAssertion_3387' is negative
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
2.45.x
Other Windows
: Normal blocker
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2015-08-30 04:00 UTC by Partha
Modified: 2015-08-31 17:51 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Partha 2015-08-30 04:00:19 UTC
Glib 2.45.6 (actually from 2.45.3 onwards) no longer compiles on Windows 10 64bit. 

Compiling with
$ gcc -v
Using built-in specs.
COLLECT_GCC=z:\foss\gcc\64bit\gcc-4.9.2\bin\gcc.exe
COLLECT_LTO_WRAPPER=z:/foss/gcc/64bit/gcc-4.9.2/bin/../libexec/gcc/x86_64-w64-mingw32/4.9.2/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../../../src/gcc-4.9.2/configure --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --prefix=/mingw64 --with-sysroot=/c/mingw492/x86_64-492-win32-seh-rt_v3-rev0/mingw64 --with-gxx-include-dir=/mingw64/x86_64-w64-mingw32/include/c++ --enable-shared --enable-static --disable-multilib --enable-languages=ada,c,c++,fortran,objc,obj-c++,lto --enable-libstdcxx-time=yes --enable-threads=win32 --enable-libgomp --enable-libatomic --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --disable-isl-version-check --disable-cloog-version-check --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=nocona --with-tune=core2 --with-libiconv --with-system-zlib --with-gmp=/c/mingw492/prerequisites/x86_64-w64-mingw32-static --with-mpfr=/c/mingw492/prerequisites/x86_64-w64-mingw32-static --with-mpc=/c/mingw492/prerequisites/x86_64-w64-mingw32-static --with-isl=/c/mingw492/prerequisites/x86_64-w64-mingw32-static --with-cloog=/c/mingw492/prerequisites/x86_64-w64-mingw32-static --enable-cloog-backend=isl --with-pkgversion='x86_64-win32-seh-rev0, Built by MinGW-W64 project' --with-bugurl=http://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -I/c/mingw492/x86_64-492-win32-seh-rt_v3-rev0/mingw64/opt/include -I/c/mingw492/prerequisites/x86_64-zlib-static/include -I/c/mingw492/prerequisites/x86_64-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -I/c/mingw492/x86_64-492-win32-seh-rt_v3-rev0/mingw64/opt/include -I/c/mingw492/prerequisites/x86_64-zlib-static/include -I/c/mingw492/prerequisites/x86_64-w64-mingw32-static/include' CPPFLAGS= LDFLAGS='-pipe -L/c/mingw492/x86_64-492-win32-seh-rt_v3-rev0/mingw64/opt/lib -L/c/mingw492/prerequisites/x86_64-zlib-static/lib -L/c/mingw492/prerequisites/x86_64-w64-mingw32-static/lib '
Thread model: win32
gcc version 4.9.2 (x86_64-win32-seh-rev0, Built by MinGW-W64 project)

----------------------Error message ---------------------------------------
gwin32appinfo.c: In function 'link_handlers_to_registered_apps':
gwin32appinfo.c:3098:3: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'gsize' [-Werror=format=]
   g_debug ("%u undefhandled extensions\n", unhandled_exts);
   ^
gwin32appinfo.c:3112:3: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'gsize' [-Werror=format=]
   g_debug ("%u undefhandled extensions\n", unhandled_exts);
   ^
In file included from ../glib/glibconfig.h:9:0,
                 from ../glib/gtypes.h:32,
                 from ../glib/galloca.h:32,
                 from ../glib/glib.h:30,
                 from ../gobject/gbinding.h:28,
                 from ../glib/glib-object.h:23,
                 from ../gio/gioenums.h:28,
                 from ../gio/giotypes.h:28,
                 from gcontenttype.h:28,
                 from gwin32appinfo.c:27:
gwin32appinfo.c: In function 'g_win32_appinfo_init':
../glib/gmacros.h:182:53: error: size of array '_GStaticAssertCompileTimeAssertion_108' is negative
 #define G_STATIC_ASSERT(expr) typedef char G_PASTE (_GStaticAssertCompileTimeAssertion_, __COUNTER__)[(expr) ? 1 : -1] G_GNUC_UNUSED
                                                     ^
../glib/gmacros.h:179:47: note: in definition of macro 'G_PASTE_ARGS'
 #define G_PASTE_ARGS(identifier1,identifier2) identifier1 ## identifier2
                                               ^
../glib/gmacros.h:182:44: note: in expansion of macro 'G_PASTE'
 #define G_STATIC_ASSERT(expr) typedef char G_PASTE (_GStaticAssertCompileTimeAssertion_, __COUNTER__)[(expr) ? 1 : -1] G_GNUC_UNUSED
                                            ^
../glib/gthread.h:249:5: note: in expansion of macro 'G_STATIC_ASSERT'
     G_STATIC_ASSERT (sizeof *(location) == sizeof (gpointer));       \
     ^
gwin32appinfo.c:3387:7: note: in expansion of macro 'g_once_init_enter'
   if (g_once_init_enter (&initialized))
       ^
In file included from ../glib/gasyncqueue.h:32:0,
                 from ../glib/glib.h:32,
                 from ../gobject/gbinding.h:28,
                 from ../glib/glib-object.h:23,
                 from ../gio/gioenums.h:28,
                 from ../gio/giotypes.h:28,
                 from gcontenttype.h:28,
                 from gwin32appinfo.c:27:
../glib/gthread.h:250:17: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     (void) (0 ? (gpointer) *(location) : 0);                         \
                 ^
gwin32appinfo.c:3387:7: note: in expansion of macro 'g_once_init_enter'
   if (g_once_init_enter (&initialized))
       ^
In file included from ../glib/glibconfig.h:9:0,
                 from ../glib/gtypes.h:32,
                 from ../glib/galloca.h:32,
                 from ../glib/glib.h:30,
                 from ../gobject/gbinding.h:28,
                 from ../glib/glib-object.h:23,
                 from ../gio/gioenums.h:28,
                 from ../gio/giotypes.h:28,
                 from gcontenttype.h:28,
                 from gwin32appinfo.c:27:
../glib/gmacros.h:182:53: error: size of array '_GStaticAssertCompileTimeAssertion_109' is negative
 #define G_STATIC_ASSERT(expr) typedef char G_PASTE (_GStaticAssertCompileTimeAssertion_, __COUNTER__)[(expr) ? 1 : -1] G_GNUC_UNUSED
                                                     ^
../glib/gmacros.h:179:47: note: in definition of macro 'G_PASTE_ARGS'
 #define G_PASTE_ARGS(identifier1,identifier2) identifier1 ## identifier2
                                               ^
../glib/gmacros.h:182:44: note: in expansion of macro 'G_PASTE'
 #define G_STATIC_ASSERT(expr) typedef char G_PASTE (_GStaticAssertCompileTimeAssertion_, __COUNTER__)[(expr) ? 1 : -1] G_GNUC_UNUSED
                                            ^
../glib/gatomic.h:107:5: note: in expansion of macro 'G_STATIC_ASSERT'
     G_STATIC_ASSERT (sizeof *(atomic) == sizeof (gpointer));                 \
     ^
../glib/gthread.h:251:7: note: in expansion of macro 'g_atomic_pointer_get'
     (!g_atomic_pointer_get (location) &&                             \
       ^
gwin32appinfo.c:3387:7: note: in expansion of macro 'g_once_init_enter'
   if (g_once_init_enter (&initialized))
       ^
../glib/gmacros.h:182:53: error: size of array '_GStaticAssertCompileTimeAssertion_110' is negative
 #define G_STATIC_ASSERT(expr) typedef char G_PASTE (_GStaticAssertCompileTimeAssertion_, __COUNTER__)[(expr) ? 1 : -1] G_GNUC_UNUSED
                                                     ^
../glib/gmacros.h:179:47: note: in definition of macro 'G_PASTE_ARGS'
 #define G_PASTE_ARGS(identifier1,identifier2) identifier1 ## identifier2
                                               ^
../glib/gmacros.h:182:44: note: in expansion of macro 'G_PASTE'
 #define G_STATIC_ASSERT(expr) typedef char G_PASTE (_GStaticAssertCompileTimeAssertion_, __COUNTER__)[(expr) ? 1 : -1] G_GNUC_UNUSED
                                            ^
../glib/gthread.h:256:5: note: in expansion of macro 'G_STATIC_ASSERT'
     G_STATIC_ASSERT (sizeof *(location) == sizeof (gpointer));       \
     ^
gwin32appinfo.c:3418:7: note: in expansion of macro 'g_once_init_leave'
       g_once_init_leave (&initialized, TRUE);
       ^
gwin32appinfo.c: In function 'g_win32_app_info_launch_internal':
gwin32appinfo.c:4206:80: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
           g_variant_builder_add (&builder, "{sv}", "pid", g_variant_new_int32 ((gint32) pid));
                                                                                ^
cc1.exe: some warnings being treated as errors
Makefile:3149: recipe for target `libgio_2_0_la-gwin32appinfo.lo' failed
make[4]: *** [libgio_2_0_la-gwin32appinfo.lo] Error 1
make[4]: *** Waiting for unfinished jobs....
gwin32registrykey.c: In function 'g_win32_registry_key_new':
gwin32registrykey.c:474:12: warning: unused variable 'result' [-Wunused-variable]
   GObject *result;
            ^
make[4]: Leaving directory `/usr/src/gnome/glib-2.45.6/gio'
Makefile:4032: recipe for target `all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/usr/src/gnome/glib-2.45.6/gio'
Makefile:1799: recipe for target `all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory `/usr/src/gnome/glib-2.45.6/gio'
Makefile:1216: recipe for target `all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/gnome/glib-2.45.6'
Makefile:858: recipe for target `all' failed
make: *** [all] Error 2
Comment 1 Matthias Clasen 2015-08-31 17:51:14 UTC
Author: Matthias Clasen <mclasen@redhat.com>
Date:   Mon Aug 31 13:48:22 2015 -0400

    win32: Fix a g_once_init_enter call
    
    g_once_init_enter must be given a gsize-sized location.
    A gboolean doesn't qualify. This broke the build on win64.