> use -Wshadow That's what I wanted. Thanks.
On Wed, Sep 12, 2012 at 2:39 PM, Shantanu Gupta <[email protected]> wrote: > Though i don't understand what you ask for, Here's nothing. > > Considering that syntax I am assuming it to be C, GCC by default should > throw an error if two variables of the same name exist in the same scope. > Consider the following: > #include<xyz.h> > > static int abc = 0; > > static void do_work(void) > { > static int abc = 1; // An error will be generated here. > blah blah... > } > > void main(int argc, void **argv) > { > do_work(); > } This code works fine. No errors (atleast not with gcc 4.6.1 on ubuntu). -- Lots o' Luv, Phani Bhushan Let not your sense of morals prevent you from doing what is right - Isaac Asimov (Salvor Hardin in Foundation and Empire) Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html -- Mailing list guidelines and other related articles: http://lug-iitd.org/Footer
