This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


RE: [Xen-API] [PATCH] imported patch removing-warnings

To: Vincent Hanquez <Vincent.Hanquez@xxxxxxxxxxxxx>
Subject: RE: [Xen-API] [PATCH] imported patch removing-warnings
From: Rok Strnisa <rok.strnisa@xxxxxxxxxx>
Date: Wed, 10 Nov 2010 12:08:44 +0000
Accept-language: en-US
Acceptlanguage: en-US
Cc: Jonathan Knowles <Jonathan.Knowles@xxxxxxxxxxxxx>, "xen-api@xxxxxxxxxxxxxxxxxxx" <xen-api@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 10 Nov 2010 04:12:38 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4CDA8827.1060607@xxxxxxxxxxxxx>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
References: <403764544b97988f2e3d.1289323667@rok-desktop> <4CDA61E7.5060509@xxxxxxxxxxxxx> <B462D1536FED1140871BC97AB218A6598EFA3A1CC7@xxxxxxxxxxxxxxxxxxxxxxxxx> <4CDA8827.1060607@xxxxxxxxxxxxx>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcuAziayE0MOYLm1QvGr0WQikv2kNwAAKenQ
Thread-topic: [Xen-API] [PATCH] imported patch removing-warnings
Hi Vincent,

> But, you are introducing future hard-to-find bugs. if nothings change
> since last i look, partial applications warning are enabled as error
> (they are really the nastiest kind of errors).
> when using let _ = .. you're explicitely telling the type system, that
> you don't care what the value is. as such it can't treat a unused
> partial application as a problem, because you're explicitely told him
> to
> ignore it. Hence in the future if someone add arguments to some
> function
> that happens to be on the right side of the let (_) = .., suddenly the
> value becomes of type "a -> b" instead of "a", which because of the let
> _ binding will be ignored (and because it's partial, the function is
> not
> applied, and possible side effects are then missing).

My patch did not introduce any future hard-to-find bugs, since any change of 
the type you describe above would still have been silently ignored by the 
compiler even without the change.

> This is why you need to type your ignored let binding with a let (_ :
> type expected) if you want to fix the warning *properly*.
> as a convenience there is a ignore_{int|string|...} in
> stdlib/pervasiveext for common type that can be ignored.

I agree that this is a better approach, but also much more time-consuming. I 
think it's worth re-emphasizing this:

> > This patch is in fact only a start of removing the sea of warnings
> that get generated while compiling xen-api.hg. Currently, there are so
> many warnings that nobody pays attention to them any more, or notices
> that they generated a new one --- the whole purpose of warnings is lost.
> The goal is to reach zero warnings, and then enable the warnings-as-
> errors flag.
> >
> > Therefore, I think the patch is safe as-is, but feel free to remove
> assignments you are definitely sure don't give side-effects _and_ were
> not meant for something else.

Because this will take some effort, I've decided to not do it all myself, but 
rather use the source control to identify who is responsible for each warning, 
and delegate it to them --- originally an idea by Jonathan Knowles.


xen-api mailing list