[Bug other/13129] New: invalid shadow declaration warning

gcc-bugzilla at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed Nov 19 20:13:00 GMT 2003


	When compiling code with -Wshadow, gcc whines if external struct or
	so is first declared (like 'extern struct foo bar;') globally and
	then locally.

Environment:
System: Linux haapana 2.4.22 #12 SMP Fri Nov 7 04:07:28 EET 2003 i686 unknown unknown GNU/Linux
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: mcore-unknown-elf
configured with: /work/gcc/configure --target=mcore-elf --with-gnu-as --with-gcc --disable-nls --enable-languages=c,objc,c++ --with-gnu-ld --prefix=/emb/cross-gcc-current --program-prefix=mcore-elf- --program-suffix= -v --with-newlib --with-headers=/pub/devel/gnu/newlib-1.11.0/newlib/libc/include

How-To-Repeat:
	/* ***** start of test.c ***** */
	/* Compile: 'mcore-elf-gcc -Wshadow -c test.c -o test.o' */
	extern struct foo bar;
	void dummy()
	{
	  extern struct foo bar;
        }
	/* *****  end of test.c  ***** */
------- Additional Comments From sami dot kantoluoto at embedtronics dot fi  2003-11-19 20:13 -------
Fix:
	Don't use -Wshadow.

-- 
           Summary: invalid shadow declaration warning
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sami dot kantoluoto at embedtronics dot fi
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: mcore-unknown-elf


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13129



More information about the Gcc-bugs mailing list