[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



Hi Rok

Thanks for looking into this area. It's good to see someone tackle
our accumulated backlog of compiler warnings. :)

I have some reservations about this patch, as it stands:

In the case where you get an "unused identifier" warning, or an
"unused variable" warning, then it's often better to remove the
assignment /entirely/. For example:

On 09/11/10 17:27, Rok Strnisa wrote:
- let record_name = OU.ocaml_of_record_name obj.DT.name in
+ let _ (* record_name *) = OU.ocaml_of_record_name obj.DT.name in

If you can be sure that evaluation of the expression on the
right-hand-side of the assignment creates no side-effects,
then it should be safe to completely remove the assignment.

For example, we can replace the above change with the following
change:

- let record_name = OU.ocaml_of_record_name obj.DT.name in

Using the "_" identifier has a tendency, unfortunately, to mask
the problem, because we no longer have an easy way to identify
wasted assignments (which the compiler warnings previously told
us about).

Rok, would you be able to revise this patch a little, so that
it completely removes all the non-side-effecting assignments to
unused identifiers?

Jonathan

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.