[NetworkManager] Fix build issues due to smarter GCC

Daniel Williams dcbw at fedoraproject.org
Wed Feb 2 04:12:56 UTC 2011


commit 2f00cb8294ccc940aca91936006e68212f55d99a
Author: Dan Williams <dcbw at redhat.com>
Date:   Tue Feb 1 22:13:35 2011 -0600

    Fix build issues due to smarter GCC

 NetworkManager.spec                       |    4 ++
 fix-uninitialized.patch                   |   45 +++++++++++++++++++++++++++++
 nm-applet-no-unused-but-set-warning.patch |   12 ++++++++
 3 files changed, 61 insertions(+), 0 deletions(-)
---
diff --git a/NetworkManager.spec b/NetworkManager.spec
index 71fe9b8..56e4b6d 100644
--- a/NetworkManager.spec
+++ b/NetworkManager.spec
@@ -33,6 +33,7 @@ Patch2: explain-dns1-dns2.patch
 Patch3: nm-applet-no-notifications.patch
 Patch4: modem-ip-interface-property-change.patch
 Patch5: no-unused-but-set-warning.patch
+Patch6: fix-uninitialized.patch
 Patch10: Port-to-libnotify-070.patch
 Patch11: gtk3-1.patch
 Patch12: gtk3-2.patch
@@ -40,6 +41,7 @@ Patch13: gtk3-3.patch
 Patch14: gtk3-4.patch
 Patch15: gtk3-5.patch
 Patch16: gtk3-6.patch
+Patch17: nm-applet-no-unused-but-set-warning.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 Requires(post): chkconfig
@@ -172,6 +174,7 @@ tar -xjf %{SOURCE1}
 %patch3 -p1 -b .no-notifications
 %patch4 -p1 -b .modem-ip-iface
 %patch5 -p1 -b .no-unused-but-set
+%patch6 -p1 -b .uninitialized
 pushd  network-manager-applet-%{realversion}
 %patch10 -p1 -b .libnotify-070
 %patch11 -p1 -b .gtk3-1
@@ -180,6 +183,7 @@ pushd  network-manager-applet-%{realversion}
 %patch14 -p1 -b .gtk3-4
 %patch15 -p1 -b .gtk3-5
 %patch16 -p1 -b .gtk3-6
+%patch17 -p1 -b .applet-no-unused-but-set
 popd
 
 %build
diff --git a/fix-uninitialized.patch b/fix-uninitialized.patch
new file mode 100644
index 0000000..f4eb63b
--- /dev/null
+++ b/fix-uninitialized.patch
@@ -0,0 +1,45 @@
+diff -up NetworkManager-0.8.2/src/nm-device-ethernet.c.uninitialized NetworkManager-0.8.2/src/nm-device-ethernet.c
+--- NetworkManager-0.8.2/src/nm-device-ethernet.c.uninitialized	2010-11-17 18:24:02.000000000 -0600
++++ NetworkManager-0.8.2/src/nm-device-ethernet.c	2011-02-01 22:03:10.633281326 -0600
+@@ -308,7 +308,7 @@ _update_s390_subchannels (NMDeviceEthern
+ 	const char *iface;
+ 	GUdevClient *client;
+ 	GUdevDevice *dev;
+-	GUdevDevice *parent;
++	GUdevDevice *parent = NULL;
+ 	const char *parent_path, *item, *driver;
+ 	const char *subsystems[] = { "net", NULL };
+ 	GDir *dir;
+diff -up NetworkManager-0.8.2/system-settings/plugins/ifcfg-rh/reader.c.uninitialized NetworkManager-0.8.2/system-settings/plugins/ifcfg-rh/reader.c
+--- NetworkManager-0.8.2/system-settings/plugins/ifcfg-rh/reader.c.uninitialized	2011-02-01 22:04:47.501070312 -0600
++++ NetworkManager-0.8.2/system-settings/plugins/ifcfg-rh/reader.c	2011-02-01 22:05:16.234711093 -0600
+@@ -893,7 +893,7 @@ error:
+ static NMIP6Address *
+ parse_full_ip6_address (const char *addr_str, GError **error)
+ {
+-	NMIP6Address *addr;
++	NMIP6Address *addr = NULL;
+ 	char **list;
+ 	char *ip_tag, *prefix_tag;
+ 	struct in6_addr tmp = IN6ADDR_ANY_INIT;
+@@ -944,7 +944,8 @@ parse_full_ip6_address (const char *addr
+ 
+ error:
+ 	if (!success) {
+-		nm_ip6_address_unref (addr);
++		if (addr)
++			nm_ip6_address_unref (addr);
+ 		addr = NULL;
+ 	}
+ 
+diff -up NetworkManager-0.8.2/system-settings/plugins/ifcfg-rh/writer.c.uninitialized NetworkManager-0.8.2/system-settings/plugins/ifcfg-rh/writer.c
+--- NetworkManager-0.8.2/system-settings/plugins/ifcfg-rh/writer.c.uninitialized	2010-10-18 18:44:05.000000000 -0500
++++ NetworkManager-0.8.2/system-settings/plugins/ifcfg-rh/writer.c	2011-02-01 22:03:10.634281314 -0600
+@@ -884,6 +884,7 @@ write_wired_setting (NMConnection *conne
+ 	svSetValue (ifcfg, "SUBCHANNELS", NULL, FALSE);
+ 	s390_subchannels = nm_setting_wired_get_s390_subchannels (s_wired);
+ 	if (s390_subchannels) {
++		tmp = NULL;
+ 	    if (s390_subchannels->len == 2) {
+ 			tmp = g_strdup_printf ("%s,%s",
+ 				                   (const char *) g_ptr_array_index (s390_subchannels, 0),
diff --git a/nm-applet-no-unused-but-set-warning.patch b/nm-applet-no-unused-but-set-warning.patch
new file mode 100644
index 0000000..d25e506
--- /dev/null
+++ b/nm-applet-no-unused-but-set-warning.patch
@@ -0,0 +1,12 @@
+diff -up network-manager-applet-0.8.2/m4/compiler_warnings.m4.foo network-manager-applet-0.8.2/m4/compiler_warnings.m4
+--- network-manager-applet-0.8.2/m4/compiler_warnings.m4.foo	2011-02-01 22:08:26.149336832 -0600
++++ network-manager-applet-0.8.2/m4/compiler_warnings.m4	2011-02-01 22:08:41.869140307 -0600
+@@ -10,7 +10,7 @@ if test "$GCC" = "yes" -a "$set_more_war
+ 	for option in -Wshadow -Wmissing-declarations -Wmissing-prototypes \
+ 		      -Wdeclaration-after-statement -Wstrict-prototypes \
+ 		      -Wfloat-equal -Wno-unused-parameter -Wno-sign-compare \
+-		      -fno-strict-aliasing; do
++		      -fno-strict-aliasing -Wno-unused-but-set-variable; do
+ 		SAVE_CFLAGS="$CFLAGS"
+ 		CFLAGS="$CFLAGS $option"
+ 		AC_MSG_CHECKING([whether gcc understands $option])


More information about the scm-commits mailing list