public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/13801] New: Decls should regain old type at end of scope
@ 2004-01-21 21:56 jsm28 at gcc dot gnu dot org
2004-01-21 21:59 ` [Bug c/13801] [3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2004-01-21 21:56 UTC (permalink / raw)
To: gcc-bugs
When an identifier gains a composite type from a declaration in an inner
scope, it must regain its old type at the end of that scope. For example,
void
foo(void)
{
extern int i[];
{
extern int i[10];
}
sizeof(i);
}
must receive a diagnostic, which it does in 3.3.2 but not now in 3.4 or 3.5.
For more details, see <http://groups.google.com/groups?th=2b5042029273bcc0>.
--
Summary: Decls should regain old type at end of scope
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: zack at gcc dot gnu dot org
ReportedBy: jsm28 at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13801
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/13801] [3.4/3.5 Regression] Decls should regain old type at end of scope
2004-01-21 21:56 [Bug c/13801] New: Decls should regain old type at end of scope jsm28 at gcc dot gnu dot org
@ 2004-01-21 21:59 ` pinskia at gcc dot gnu dot org
2004-01-22 21:07 ` zack at gcc dot gnu dot org
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-21 21:59 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-01-21 21:59 -------
Confirmed. A regression.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Ever Confirmed| |1
Keywords| |diagnostic
Last reconfirmed|0000-00-00 00:00:00 |2004-01-21 21:59:04
date| |
Summary|Decls should regain old type|[3.4/3.5 Regression] Decls
|at end of scope |should regain old type at
| |end of scope
Target Milestone|--- |3.4.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13801
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/13801] [3.4/3.5 Regression] Decls should regain old type at end of scope
2004-01-21 21:56 [Bug c/13801] New: Decls should regain old type at end of scope jsm28 at gcc dot gnu dot org
2004-01-21 21:59 ` [Bug c/13801] [3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
@ 2004-01-22 21:07 ` zack at gcc dot gnu dot org
2004-03-01 5:15 ` mmitchel at gcc dot gnu dot org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: zack at gcc dot gnu dot org @ 2004-01-22 21:07 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From zack at gcc dot gnu dot org 2004-01-22 21:07 -------
since this is such bizarre code, fixing it is not a high priority.
--
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |accepts-invalid
Priority|P2 |P3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13801
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/13801] [3.4/3.5 Regression] Decls should regain old type at end of scope
2004-01-21 21:56 [Bug c/13801] New: Decls should regain old type at end of scope jsm28 at gcc dot gnu dot org
2004-01-21 21:59 ` [Bug c/13801] [3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
2004-01-22 21:07 ` zack at gcc dot gnu dot org
@ 2004-03-01 5:15 ` mmitchel at gcc dot gnu dot org
2004-08-11 21:05 ` jsm28 at gcc dot gnu dot org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-03-01 5:15 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mmitchel at gcc dot gnu dot org 2004-03-01 05:15 -------
Fixing this problem requires the c-decl.c rewrite to be finished, and that is
too risk for 3.4 at this point, so I have moved the target to 3.5.
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|3.4.0 |3.5.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13801
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/13801] [3.4/3.5 Regression] Decls should regain old type at end of scope
2004-01-21 21:56 [Bug c/13801] New: Decls should regain old type at end of scope jsm28 at gcc dot gnu dot org
` (2 preceding siblings ...)
2004-03-01 5:15 ` mmitchel at gcc dot gnu dot org
@ 2004-08-11 21:05 ` jsm28 at gcc dot gnu dot org
2004-08-26 21:30 ` cvs-commit at gcc dot gnu dot org
2004-08-26 21:45 ` pinskia at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2004-08-11 21:05 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
OtherBugsDependingO| |16989
nThis| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13801
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/13801] [3.4/3.5 Regression] Decls should regain old type at end of scope
2004-01-21 21:56 [Bug c/13801] New: Decls should regain old type at end of scope jsm28 at gcc dot gnu dot org
` (3 preceding siblings ...)
2004-08-11 21:05 ` jsm28 at gcc dot gnu dot org
@ 2004-08-26 21:30 ` cvs-commit at gcc dot gnu dot org
2004-08-26 21:45 ` pinskia at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-08-26 21:30 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-08-26 21:30 -------
Subject: Bug 13801
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: jsm28@gcc.gnu.org 2004-08-26 21:30:26
Modified files:
gcc : ChangeLog c-decl.c
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/gcc.dg/debug: redecl-1.c redecl-2.c redecl-3.c
redecl-4.c redecl-5.c
gcc/testsuite/gcc.dg: redecl-3.c redecl-4.c redecl-6.c
redecl-7.c redecl-8.c redecl-9.c
redecl-10.c
Log message:
PR c/13801
* c-decl.c (struct c_binding): Add type and inner_comp fields.
(bind): Set type and inner_comp fields.
(pop_scope): Restore type of decl to the correct type from an
outer scope. Give error when popping file scope for incomplete
arrays completed incompatibly with default initialization in an
inner scope.
(diagnose_mismatched_decls): Handle externs with initializers at
block scope.
(pushdecl): Set type of external declaration at block scope based
only on the visible declarations. Save type when changing the
type of a declaration. Merge an external declaration at block
scope with a visible static declaration at file scope.
(implicitly_declare): Give recycled old declaration the new type
except for incompatible declarations of built-in functions, saving
the old type.
testsuite:
* gcc.dg/redecl-3.c, gcc.dg/redecl-4.c, gcc.dg/redecl-6.c,
gcc.dg/redecl-7.c, gcc.dg/redecl-8.c, gcc.dg/redecl-9.c,
gcc.dg/redecl-10.c, gcc.dg/debug/redecl-1.c,
gcc.dg/debug/redecl-2.c, gcc.dg/debug/redecl-3.c,
gcc.dg/debug/redecl-4.c, gcc.dg/debug/redecl-5.c: New tests.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.5110&r2=2.5111
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-decl.c.diff?cvsroot=gcc&r1=1.563&r2=1.564
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4200&r2=1.4201
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/debug/redecl-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/debug/redecl-2.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/debug/redecl-3.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/debug/redecl-4.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/debug/redecl-5.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/redecl-3.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/redecl-4.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/redecl-6.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/redecl-7.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/redecl-8.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/redecl-9.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/redecl-10.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13801
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c/13801] [3.4/3.5 Regression] Decls should regain old type at end of scope
2004-01-21 21:56 [Bug c/13801] New: Decls should regain old type at end of scope jsm28 at gcc dot gnu dot org
` (4 preceding siblings ...)
2004-08-26 21:30 ` cvs-commit at gcc dot gnu dot org
@ 2004-08-26 21:45 ` pinskia at gcc dot gnu dot org
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-26 21:45 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-08-26 21:45 -------
Fixed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13801
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2004-08-26 21:45 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-21 21:56 [Bug c/13801] New: Decls should regain old type at end of scope jsm28 at gcc dot gnu dot org
2004-01-21 21:59 ` [Bug c/13801] [3.4/3.5 Regression] " pinskia at gcc dot gnu dot org
2004-01-22 21:07 ` zack at gcc dot gnu dot org
2004-03-01 5:15 ` mmitchel at gcc dot gnu dot org
2004-08-11 21:05 ` jsm28 at gcc dot gnu dot org
2004-08-26 21:30 ` cvs-commit at gcc dot gnu dot org
2004-08-26 21:45 ` pinskia 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).