Re: Question about variable scope conflict
- From: David Mathog <mathog@xxxxxxxxxxx>
- Date: Fri, 30 Nov 2007 10:05:37 -0800
santosh wrote:
Use the -Wshadow switch for gcc.
I never would have thought to call it that.
Any idea where the term "shadow variable" in this context originated? Only two threads using that term have previously appeared in this group, and only two in comp.lang.c++. A bit of googling on the web at large turned up what appear to be different usages of the term for VoiceXML automake, and several others. In most of these it means not overlapping declarations, but using two variables with slightly different names, and often different types, which are operated on similarly in most of the code. Here is a typical use, ironically again with respect to gcc:
http://developer.apple.com/documentation/Performance/Conceptual/CodeSpeed/Articles/ImpedanceMismatch.html
Thanks,
David Mathog
.
- Follow-Ups:
- Re: Question about variable scope conflict
- From: santosh
- Re: Question about variable scope conflict
- References:
- Question about variable scope conflict
- From: David Mathog
- Re: Question about variable scope conflict
- From: santosh
- Question about variable scope conflict
- Prev by Date: Re: Global Variables : Where are they stored ?
- Next by Date: Re: Global Variables : Where are they stored ?
- Previous by thread: Re: Question about variable scope conflict
- Next by thread: Re: Question about variable scope conflict
- Index(es):