build: use -Wundef and fix up cases where stuff wasn't defined (bgo #647157)
authorDan Williams <dcbw@redhat.com>
Thu, 14 Apr 2011 18:16:55 +0000 (13:16 -0500)
committerDan Williams <dcbw@redhat.com>
Thu, 14 Apr 2011 18:19:12 +0000 (13:19 -0500)
configure.ac
libnm-glib/nm-client.c
libnm-glib/nm-object.c
libnm-util/nm-connection.c
m4/compiler_warnings.m4
src/nm-policy.c

index e45c6e1..e0af630 100644 (file)
@@ -315,6 +315,8 @@ if (test "${enable_wimax}" = "yes"); then
        AC_SUBST(IWMX_SDK_CFLAGS)
        AC_SUBST(IWMX_SDK_LIBS)
        AC_DEFINE(WITH_WIMAX, 1, [Define if you have WiMAX support])
+else
+       AC_DEFINE(WITH_WIMAX, 0, [Define if you have WiMAX support])
 fi
 AM_CONDITIONAL(WITH_WIMAX, test "${enable_wimax}" = "yes")
 
@@ -391,6 +393,8 @@ if (test "${enable_ppp}" = "yes"); then
                AC_MSG_ERROR(couldn't find pppd.h. pppd development headers are required.))
 
        AC_DEFINE(WITH_PPP, 1, [Define if you have PPP support])
+else
+       AC_DEFINE(WITH_PPP, 0, [Define if you have PPP support])
 fi
 AM_CONDITIONAL(WITH_PPP, test "${enable_ppp}" = "yes")
 
index fa60f21..644af3e 100644 (file)
@@ -227,7 +227,6 @@ update_wwan_status (NMClient *client, gboolean notify)
        }
 }
 
-#if WITH_WIMAX
 static void
 update_wimax_status (NMClient *client, gboolean notify)
 {
@@ -259,7 +258,6 @@ update_wimax_status (NMClient *client, gboolean notify)
                        _nm_object_queue_notify (NM_OBJECT (client), NM_CLIENT_WIMAX_ENABLED);
        }
 }
-#endif
 
 static GObject *
 new_active_connection (DBusGConnection *connection, const char *path)
@@ -1231,9 +1229,7 @@ proxy_name_owner_changed (DBusGProxy *proxy,
                _nm_object_queue_notify (NM_OBJECT (client), NM_CLIENT_MANAGER_RUNNING);
                update_wireless_status (client, TRUE);
                update_wwan_status (client, TRUE);
-#if WITH_WIMAX
                update_wimax_status (client, TRUE);
-#endif
        }
 }
 
@@ -1384,9 +1380,7 @@ constructor (GType type,
        if (priv->manager_running) {
                update_wireless_status (NM_CLIENT (object), FALSE);
                update_wwan_status (NM_CLIENT (object), FALSE);
-#if WITH_WIMAX
                update_wimax_status (NM_CLIENT (object), FALSE);
-#endif
                nm_client_get_state (NM_CLIENT (object));
        }
 
index 8540ccc..0b88be2 100644 (file)
@@ -29,6 +29,7 @@
 #include "nm-object-private.h"
 #include "nm-dbus-glib-types.h"
 
+#define DEBUG 0
 
 G_DEFINE_ABSTRACT_TYPE (NMObject, nm_object, G_TYPE_OBJECT)
 
index ab366e0..cd9d53f 100644 (file)
@@ -162,7 +162,7 @@ setting_register (const char *name, GType type)
        g_hash_table_insert (registered_settings, g_strdup (name), g_strdup (g_type_name (type)));
 }
 
-#if UNUSED
+#if 0
 static void
 setting_unregister (const char *name)
 {
index be69af2..55ecfe1 100644 (file)
@@ -10,7 +10,8 @@ if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
        for option in -Wshadow -Wmissing-declarations -Wmissing-prototypes \
                      -Wdeclaration-after-statement -Wstrict-prototypes \
                      -Wfloat-equal -Wno-unused-parameter -Wno-sign-compare \
-                     -fno-strict-aliasing -Wno-unused-but-set-variable; do
+                     -fno-strict-aliasing -Wno-unused-but-set-variable \
+                     -Wundef; do
                SAVE_CFLAGS="$CFLAGS"
                CFLAGS="$CFLAGS $option"
                AC_MSG_CHECKING([whether gcc understands $option])
index fcada54..333082e 100644 (file)
@@ -539,7 +539,7 @@ update_ip6_routing_and_dns (NMPolicy *policy, gboolean force_update)
        NMActRequest *best_req = NULL;
        NMDnsManager *dns_mgr;
        GSList *devices = NULL, *iter;
-#if NOT_YET
+#if 0
        GSList *vpns;
 #endif
        NMIP6Config *ip6_config = NULL;
@@ -555,7 +555,7 @@ update_ip6_routing_and_dns (NMPolicy *policy, gboolean force_update)
        if (!force_update && (best == policy->default_device6))
                goto out;
 
-#if NOT_YET
+#if 0
        /* If a VPN connection is active, it is preferred */
        vpns = nm_vpn_manager_get_active_connections (policy->vpn_manager);
        for (iter = vpns; iter; iter = g_slist_next (iter)) {