WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

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

To: Jonathan Knowles <Jonathan.Knowles@xxxxxxxxxxxxx>, 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 10:51:16 +0000
Accept-language: en-US
Acceptlanguage: en-US
Cc: "xen-api@xxxxxxxxxxxxxxxxxxx" <xen-api@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 10 Nov 2010 02:51:31 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4CDA61E7.5060509@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>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcuAt2rEDz+TENlqSgal0f5gryPUFgACmLGg
Thread-topic: [Xen-API] [PATCH] imported patch removing-warnings
Hi Jon, Vincent,

I'm glad patches are getting reviewed :)

I know that an empty assignment with no side-effects can be removed, and I did 
it in some of the most obvious cases. However, I think it's better to be 
conservative here, rather than introducing hard-to-find bugs, which occur due 
to subtle side-effects missing.

Also, you have to consider the other option, i.e. that the statement should be 
there, and that something else, which uses this statement, is missing.

Using "_" (and a commented out variable name) makes it obvious in the code that 
a certain variable is not used (maybe we should write an IDE plug-in that does 
this?). Therefore, when a person who is familiar with (or even wrote) the code 
sees this, he can make the final decision about the removal, or do something 
else.

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.

Thanks a lot for your feedback.

Regards,
Rok

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api