[virt-tools-list] [PATCH virt-viewer] Make sure the compiler supports C99
Tiziano Müller
tiziano.mueller at stepping-stone.ch
Fri Jun 13 13:50:08 UTC 2014
Am 13.06.2014 15:33, schrieb Christophe Fergeau:
> 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.
Works for me, thanks.
ACK
--
stepping stone GmbH
Neufeldstrasse 9
CH-3012 Bern
Telefon: +41 31 332 53 63
www.stepping-stone.ch
tiziano.mueller@@stepping-stone.ch
More information about the virt-tools-list
mailing list