Enable warnings, remove all warnings from build.
authorRichard W.M. Jones <rjones@redhat.com>
Tue, 2 Dec 2008 08:14:36 +0000 (08:14 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Tue, 2 Dec 2008 08:14:36 +0000 (08:14 +0000)
Makefile.am
configure.ac
main.c

index fdf7428..1247729 100644 (file)
@@ -19,7 +19,7 @@
 bin_PROGRAMS = ovirt-viewer
 
 ovirt_viewer_SOURCES = main.c wui_thread.c internal.h
-ovirt_viewer_CFLAGS = $(OVIRT_VIEWER_CFLAGS) -Wall -DCAINFO='"$(CAINFO)"'
+ovirt_viewer_CFLAGS = $(OVIRT_VIEWER_CFLAGS) -DCAINFO='"$(CAINFO)"'
 ovirt_viewer_LDADD = $(OVIRT_VIEWER_LIBS)
 
 EXTRA_DIST = $(PACKAGE).spec
index edea64c..e597939 100644 (file)
@@ -46,6 +46,15 @@ AC_ARG_ENABLE([cainfo],
        [CAINFO=$sysconfdir/pki/tls/certs/ca-bundle.crt])
 AC_SUBST([CAINFO])
 
+dnl If the C compiler is really GCC, enable warnings and
+dnl GCC-specific flags.  Bug in glib GStaticMutex prevents
+dnl us from using strict aliasing safely.
+dnl NB: We have to do this after all the function tests
+dnl because '-Werror' tends to break them.
+if test "$GCC" = "yes"; then
+  CFLAGS="$CFLAGS -Wall -Werror -fno-strict-aliasing"
+fi
+
 dnl Output.
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_FILES([Makefile])
diff --git a/main.c b/main.c
index 3a49fe7..f6e5e08 100644 (file)
--- a/main.c
+++ b/main.c
@@ -62,7 +62,9 @@ static void destroy (GtkWidget *widget, gpointer data);
 static void clear_connectmenu (void);
 static void help_about (GtkWidget *menu);
 static void viewer_shutdown (GtkWidget *src, void *dummy, GtkWidget *vnc);
+#if 0
 static void viewer_quit (GtkWidget *src, GtkWidget *vnc);
+#endif
 static void viewer_connected (GtkWidget *vnc);
 static void viewer_initialized (GtkWidget *vnc, GtkWidget *data);
 static void viewer_disconnected (GtkWidget *vnc);
@@ -605,11 +607,13 @@ viewer_shutdown (GtkWidget *src, void *dummy, GtkWidget *vnc)
                                                   vnc));
 }
 
+#if 0
 static void
 viewer_quit (GtkWidget *src, GtkWidget *vnc)
 {
   viewer_shutdown (src, NULL, vnc);
 }
+#endif
 
 static void
 viewer_connected (GtkWidget *vnc)