[virt-tools-list] [PATCH virt-viewer] Make sure the compiler supports C99

Christophe Fergeau cfergeau at redhat.com
Fri Jun 13 13:33:45 UTC 2014


On Fri, Jun 13, 2014 at 03:21:29PM +0200, Tiziano Müller wrote:
> Otherwise passing explicit CFLAGS may omit the -std=c99, resulting in
> build failures. Requesting for a compiler supporting C99 makes sure
> -std=c99 is always passed along.

I haven't been able to hit issues when overriding CFLAGS manually
(either through make CFLAGS=... or CFLAGS=... ./autogen.sh).
However, passing --enable-compile-warnings=minimum removes -std=c99 from
the default CFLAGS, but this only exhibit minor issues:

diff --git a/src/virt-viewer-session.c b/src/virt-viewer-session.c
index 20d5fb1..b600481 100644
--- a/src/virt-viewer-session.c
+++ b/src/virt-viewer-session.c
@@ -395,13 +395,14 @@
virt_viewer_session_on_monitor_geometry_changed(VirtViewer
     gboolean all_fullscreen = TRUE;
     guint nmonitors = 0;
     GdkRectangle *monitors = NULL;
+    GList *l;
 
     klass = VIRT_VIEWER_SESSION_GET_CLASS(self);
     if (!klass->apply_monitor_geometry)
         return;
 
     /* find highest monitor ID so we can create the sparse array */
-    for (GList *l = self->priv->displays; l; l = l->next) {
+    for (l = self->priv->displays; l; l = l->next) {
         VirtViewerDisplay *d = VIRT_VIEWER_DISPLAY(l->data);
         guint nth = 0;
         g_object_get(d, "nth-display", &nth, NULL);
@@ -410,7 +411,7 @@
virt_viewer_session_on_monitor_geometry_changed(VirtViewerSe
     }
 
     monitors = g_new0(GdkRectangle, nmonitors);
-    for (GList *l = self->priv->displays; l; l = l->next) {
+    for (l = self->priv->displays; l; l = l->next) {
         VirtViewerDisplay *d = VIRT_VIEWER_DISPLAY(l->data);
         guint nth = 0;
         GdkRectangle *rect = NULL;

I'd tend to just fix this and not force --std=c99 since we don't really
need it at this point.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20140613/4c1fdebb/attachment.sig>


More information about the virt-tools-list mailing list