GNOME Bugzilla – Bug 692079
build failure in gmarkup.c when using gcc 4.8 and building for the win64 target
Last modified: 2013-01-19 19:34:38 UTC
GCC 4.8 has started to consider formatting issues as fatal errors (in earlier versions of GCC this used to be a warning). This causes a build failure when trying to build glib for the win64 target using gcc 4.8: CC libglib_2_0_la-gmarkup.lo ../../glib/gmarkup.c: In function 'g_markup_parse_context_ref': ../../glib/gmarkup.c:289:34: warning: typedef '_GStaticAssertCompileTimeAssertion_0' locally defined but not used [-Wunused-local-typedefs] g_atomic_int_inc (&context->ref_count); ^ ../../glib/gmarkup.c: In function 'g_markup_parse_context_unref': ../../glib/gmarkup.c:309:38: warning: typedef '_GStaticAssertCompileTimeAssertion_1' locally defined but not used [-Wunused-local-typedefs] if (g_atomic_int_dec_and_test (&context->ref_count)) ^ ../../glib/gmarkup.c: In function 'unescape_gstring_inplace': ../../glib/gmarkup.c:687:39: error: field precision specifier '.*' expects argument of type 'int', but argument 6 has type 'long long int' [-Werror=format=] end - from, from); ^ ../../glib/gmarkup.c:722:43: error: field precision specifier '.*' expects argument of type 'int', but argument 6 has type 'long long int' [-Werror=format=] end - from, from); ^ ../../glib/gmarkup.c:767:41: error: field precision specifier '.*' expects argument of type 'int', but argument 6 has type 'long long int' [-Werror=format=] end-from, from); ^ cc1: some warnings being treated as errors make[4]: *** [libglib_2_0_la-gmarkup.lo] Error 1 The GStaticAssertCompileTimeAssertion warnings are already being handled in bug 686773. When building glib for the win64 target using gcc 4.7 then only the following warnings are shown: CC libglib_2_0_la-gmarkup.lo ../../glib/gmarkup.c: In function 'unescape_gstring_inplace': ../../glib/gmarkup.c:687:39: warning: field precision specifier '.*' expects argument of type 'int', but argument 6 has type 'long long int' [-Wformat] ../../glib/gmarkup.c:722:43: warning: field precision specifier '.*' expects argument of type 'int', but argument 6 has type 'long long int' [-Wformat] ../../glib/gmarkup.c:767:41: warning: field precision specifier '.*' expects argument of type 'int', but argument 6 has type 'long long int' [-Wformat] For now I've managed to work around it by setting the CFLAGS to -Wno-error=format='.*', but that of course isn't a real solution