public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/13129] New: invalid shadow declaration warning
@ 2003-11-19 20:13 gcc-bugzilla at gcc dot gnu dot org
  2003-11-19 20:44 ` [Bug c/13129] [3.4 Regression] " pinskia at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: gcc-bugzilla at gcc dot gnu dot org @ 2003-11-19 20:13 UTC (permalink / raw)
  To: gcc-bugs

	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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c/13129] [3.4 Regression] invalid shadow declaration warning
  2003-11-19 20:13 [Bug other/13129] New: invalid shadow declaration warning gcc-bugzilla at gcc dot gnu dot org
@ 2003-11-19 20:44 ` pinskia at gcc dot gnu dot org
  2003-12-19  6:41 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-11-19 20:44 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-11-19 20:44 -------
I can confirm this on the mainline (20031117), it is a regression from 3.3.
>From Phil's regression hunter: Search converges between 2003-04-11-trunk (#264) and 2003-04
-12-trunk (#265).
This only happens in the c front-end.
I think this patch <http://gcc.gnu.org/ml/gcc-patches/2003-04/msg00767.html> or <http://
gcc.gnu.org/ml/gcc-patches/2003-04/msg00766.html> this patch caused it.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |zack at codesourcery dot com
             Status|UNCONFIRMED                 |NEW
          Component|other                       |c
     Ever Confirmed|                            |1
           Keywords|                            |diagnostic
   Last reconfirmed|0000-00-00 00:00:00         |2003-11-19 20:44:11
               date|                            |
            Summary|invalid shadow declaration  |[3.4 Regression] invalid
                   |warning                     |shadow declaration warning
   Target Milestone|---                         |3.4


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c/13129] [3.4 Regression] invalid shadow declaration warning
  2003-11-19 20:13 [Bug other/13129] New: invalid shadow declaration warning gcc-bugzilla at gcc dot gnu dot org
  2003-11-19 20:44 ` [Bug c/13129] [3.4 Regression] " pinskia at gcc dot gnu dot org
@ 2003-12-19  6:41 ` pinskia at gcc dot gnu dot org
  2003-12-29 17:51 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-12-19  6:41 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-12-19 06:35 -------
I should have assigned this to you.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |zack at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c/13129] [3.4 Regression] invalid shadow declaration warning
  2003-11-19 20:13 [Bug other/13129] New: invalid shadow declaration warning gcc-bugzilla at gcc dot gnu dot org
  2003-11-19 20:44 ` [Bug c/13129] [3.4 Regression] " pinskia at gcc dot gnu dot org
  2003-12-19  6:41 ` pinskia at gcc dot gnu dot org
@ 2003-12-29 17:51 ` pinskia at gcc dot gnu dot org
  2004-03-16 20:57 ` [Bug c/13129] [3.4/3.5 " zack at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-12-29 17:51 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c/13129] [3.4/3.5 Regression] invalid shadow declaration warning
  2003-11-19 20:13 [Bug other/13129] New: invalid shadow declaration warning gcc-bugzilla at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2003-12-29 17:51 ` pinskia at gcc dot gnu dot org
@ 2004-03-16 20:57 ` zack at gcc dot gnu dot org
  2004-03-22 17:58 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: zack at gcc dot gnu dot org @ 2004-03-16 20:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From zack at gcc dot gnu dot org  2004-03-16 20:57 -------
Fixed by the c-decl.c rewrite:
http://gcc.gnu.org/ml/gcc-patches/2004-03/msg01280.html

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c/13129] [3.4/3.5 Regression] invalid shadow declaration warning
  2003-11-19 20:13 [Bug other/13129] New: invalid shadow declaration warning gcc-bugzilla at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2004-03-16 20:57 ` [Bug c/13129] [3.4/3.5 " zack at gcc dot gnu dot org
@ 2004-03-22 17:58 ` cvs-commit at gcc dot gnu dot org
  2004-03-22 18:08 ` [Bug c/13129] [3.5 " mmitchel at gcc dot gnu dot org
  2004-03-23 23:53 ` zack at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-03-22 17:58 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-03-22 17:58 -------
Subject: Bug 13129

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	mmitchel@gcc.gnu.org	2004-03-22 17:58:34

Modified files:
	gcc            : ChangeLog c-decl.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gcc.dg: Wshadow-2.c 

Log message:
	PR c/13129
	* c-decl.c (warn_if_shadowing): Don't warn about a new declaration
	of a file-scope entity.
	
	PR c/13129
	* gcc.dg/Wshadow-2.c: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.363&r2=2.2326.2.364
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-decl.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.470.4.12&r2=1.470.4.13
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.156&r2=1.3389.2.157
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/Wshadow-2.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1



-- 


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c/13129] [3.5 Regression] invalid shadow declaration warning
  2003-11-19 20:13 [Bug other/13129] New: invalid shadow declaration warning gcc-bugzilla at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2004-03-22 17:58 ` cvs-commit at gcc dot gnu dot org
@ 2004-03-22 18:08 ` mmitchel at gcc dot gnu dot org
  2004-03-23 23:53 ` zack at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-03-22 18:08 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-03-22 18:08 -------
Fixed in GCC 3.4 -- but not GCC 3.5 yet.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[3.4/3.5 Regression] invalid|[3.5 Regression] invalid
                   |shadow declaration warning  |shadow declaration warning
   Target Milestone|3.4.0                       |3.5.0


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c/13129] [3.5 Regression] invalid shadow declaration warning
  2003-11-19 20:13 [Bug other/13129] New: invalid shadow declaration warning gcc-bugzilla at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2004-03-22 18:08 ` [Bug c/13129] [3.5 " mmitchel at gcc dot gnu dot org
@ 2004-03-23 23:53 ` zack at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: zack at gcc dot gnu dot org @ 2004-03-23 23:53 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From zack at gcc dot gnu dot org  2004-03-23 23:53 -------
Now fixed in 3.5.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-03-23 23:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-19 20:13 [Bug other/13129] New: invalid shadow declaration warning gcc-bugzilla at gcc dot gnu dot org
2003-11-19 20:44 ` [Bug c/13129] [3.4 Regression] " pinskia at gcc dot gnu dot org
2003-12-19  6:41 ` pinskia at gcc dot gnu dot org
2003-12-29 17:51 ` pinskia at gcc dot gnu dot org
2004-03-16 20:57 ` [Bug c/13129] [3.4/3.5 " zack at gcc dot gnu dot org
2004-03-22 17:58 ` cvs-commit at gcc dot gnu dot org
2004-03-22 18:08 ` [Bug c/13129] [3.5 " mmitchel at gcc dot gnu dot org
2004-03-23 23:53 ` zack at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).