This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: scoping of declarations in loops and -Wshadow


On Tue, 24 Mar 1998, Niall Smart wrote:
>         for (int i = 0; i < 10; i++)
>                 j = i;  
>         for (int i = 0; i < 10; i++)
>                 j = i;
> 
> One or other of the following warnings is bogus, I believe.
>
> foo.c:9: warning: declaration of `i' shadows previous local

You are right, this warning definitely is incorrect.

(Actually I reported this as a bug before, cf.
http://www.cygnus.com/ml/egcs-bugs/1997-Dec/0380.html) 

Gerald
-- 
Gerald Pfeifer (Jerry)      Vienna University of Technology
pfeifer@dbai.tuwien.ac.at   http://www.dbai.tuwien.ac.at/~pfeifer/





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]