[mingw-glib2] Replaced the gcc 4.8 workaround with a more proper fix

Erik van Pienbroek epienbro at fedoraproject.org
Sun Jan 20 14:58:40 UTC 2013


commit 25630468d10f5b8504107b0a11528f29ff25e441
Author: Erik van Pienbroek <epienbro at fedoraproject.org>
Date:   Sun Jan 20 15:58:26 2013 +0100

    Replaced the gcc 4.8 workaround with a more proper fix

 commit-9e9d028.patch |   44 ++++++++++++++++++++++++++++++++++++++++++++
 mingw-glib2.spec     |   13 +++++++++----
 2 files changed, 53 insertions(+), 4 deletions(-)
---
diff --git a/commit-9e9d028.patch b/commit-9e9d028.patch
new file mode 100644
index 0000000..19f37ec
--- /dev/null
+++ b/commit-9e9d028.patch
@@ -0,0 +1,44 @@
+From 9e9d028b96b3e19902a40b930418a0ec3e30ccfc Mon Sep 17 00:00:00 2001
+From: Matthias Clasen <mclasen at redhat.com>
+Date: Sat, 19 Jan 2013 19:30:05 +0000
+Subject: Fix build with -Werror=format
+
+There were a few places in gmarkup.c where we were giving
+pointer differences when integers are expected. Fix that
+by explicitly casting to int.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=692079
+---
+diff --git a/glib/gmarkup.c b/glib/gmarkup.c
+index bf7c008..552773f 100644
+--- a/glib/gmarkup.c
++++ b/glib/gmarkup.c
+@@ -684,7 +684,7 @@ unescape_gstring_inplace (GMarkupParseContext  *context,
+                                         "inside a character reference "
+                                         "(&#234; for example) - perhaps "
+                                         "the digit is too large"),
+-                                      end - from, from);
++                                      (int)(end - from), from);
+                   return FALSE;
+                 }
+               else if (*end != ';')
+@@ -719,7 +719,7 @@ unescape_gstring_inplace (GMarkupParseContext  *context,
+                                           from, G_MARKUP_ERROR_PARSE,
+                                           _("Character reference '%-.*s' does not "
+                                             "encode a permitted character"),
+-                                          end - from, from);
++                                          (int)(end - from), from);
+                       return FALSE;
+                     }
+                 }
+@@ -764,7 +764,7 @@ unescape_gstring_inplace (GMarkupParseContext  *context,
+                     set_unescape_error (context, error,
+                                         from, G_MARKUP_ERROR_PARSE,
+                                         _("Entity name '%-.*s' is not known"),
+-                                        end-from, from);
++                                        (int)(end - from), from);
+                   else
+                     set_unescape_error (context, error,
+                                         from, G_MARKUP_ERROR_PARSE,
+--
+cgit v0.9.0.2
diff --git a/mingw-glib2.spec b/mingw-glib2.spec
index 54e6b1e..30a361e 100644
--- a/mingw-glib2.spec
+++ b/mingw-glib2.spec
@@ -2,7 +2,7 @@
 
 Name:           mingw-glib2
 Version:        2.35.4
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        MinGW Windows GLib2 library
 
 License:        LGPLv2+
@@ -55,6 +55,10 @@ Patch2:         glib-build-dbus-proxy-testcase-only-on-unix.patch
 # https://bugzilla.gnome.org/show_bug.cgi?id=692085
 Patch3:         glib-send-log-messages-to-correct-stdout-and-stderr.patch
 
+# Fix build failure when using gcc 4.8
+# https://bugzilla.gnome.org/show_bug.cgi?id=692079
+# Upstream commit 9e9d028
+Patch4:         commit-9e9d028.patch
 
 %description
 MinGW Windows Glib2 library.
@@ -99,14 +103,12 @@ Static version of the MinGW Windows GLib2 library.
 %patch1 -p1
 %patch2 -p1
 %patch3 -p0
+%patch4 -p1
 
 autoreconf -i --force
 
 
 %build
-# Work around more strict behaviour of gcc 4.8, GNOME BZ #692079
-export MINGW64_CFLAGS="%mingw64_cflags -Wno-error=format='.*'"
-
 #GLib can't build static and shared libraries in one go, so we build GLib twice
 MINGW_BUILDDIR_SUFFIX=static %mingw_configure --disable-shared --enable-static
 MINGW_BUILDDIR_SUFFIX=shared %mingw_configure --disable-static
@@ -282,6 +284,9 @@ find $RPM_BUILD_ROOT -name "*.la" -delete
 
 
 %changelog
+* Sun Jan 20 2013 Erik van Pienbroek <epienbro at fedoraproject.org> - 2.35.4-3
+- Replaced the gcc 4.8 workaround with a more proper fix (GNOME BZ #692079)
+
 * Sat Jan 19 2013 Erik van Pienbroek <epienbro at fedoraproject.org> - 2.35.4-2
 - Work around more strict behaviour of gcc 4.8, GNOME BZ #692079
 - Use verbose make


More information about the scm-commits mailing list