This discussion should probably stay on -devel, if only to make sure
everyone has a chance to yell at me for making "sweeping changes"
right before a release.

On Tue, 29 Jan 2013, John Peterson wrote:

> IMO I have found a couple of "legitimate" cases of variable shadowing.
> See, for example, around line 193 of parallel_ghost_sync.h.  There's
> an outer loop on 'unsigned p' and inside the loop we create 'Point p'.

I actually changed that to "Point pt" last night.  ;-)

> Although I believe the code has been correct as written in each case
> (the author was actually referring to the most recently-created
> variable) I'm still fixing those cases.

I'm likewise proceeding with a "better safe than sorry" policy.
Basically, while working on the dof_id_type stuff I discovered that
there were truncation bugs which -Wconversion caught but which I'd
never have noticed myself until a 2-billion-dof job was corrupted, and
the only way I'll notice serious -Wconversion warnings is if we manage
to get rid of all the "false positive" warnings.

> A bigger issue is that the compiler reports *every* possible kind of
> shadowing.  For example, a variable name can shadow a member function
> of a class!  So, for example, the DofObject::set_id() function:
> 
> void set_id (const unsigned int id)
> { this->set_id() = id; }

And I changed that to "const dof_id_type id" a while ago to fix a
conversion bug, then "const dof_id_type dofid" to fix the shadowing
warning last night.  I'll stop futzing with shadowing fixes now that I
know you're working on them, though.

These changes are so sweeping I'd suggest not making a huge patch of
them, though, but rather just regularly pulling and committing, both
to reduce the size of the resulting merge conflicts and to make it
easier to "git bisect" if a typo in the changes breaks something.
---
Roy

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to