On 10/28/2015 10:31 AM, Jan Beulich wrote:
On 28.10.15 at 10:12, <jgr...@suse.com> wrote:
On 10/28/2015 09:53 AM, Jan Beulich wrote:
And second variables
whose name is kind of natural (e.g. "d" for struct domain * instances)
but which are intentionally shadowing a larger scope one in order to
not clobber that one's value.

Hmm, wouldn't something like tmp_d or d_tmp be a proper solution?

Ugly. Really ugly.

Maybe. OTOH I'm quite sure there is a name which would be acceptable.
Otherwise we couldn't write code referencing two different domains via
local variables without making it ugly.

There are other cases where more than one domain reference are needed
and it was possible to find proper variable names.

Yes, resulting in e.g. "e" being used for a struct domain * in grant
table code. Very natural a name for this kind of object.

Bad examples are always possible. This is no excuse not to use compiler
features which help us to avoid bugs.


Juergen

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to