[Bug c/14366] variable previously declared `static' redeclared `extern' is valid ISO C - 3.4 and 4.0 regression
--- Comment #8 from pinskia at gcc dot gnu dot org 2007-07-09 12:16 --- *** Bug 32692 has been marked as a duplicate of this bug. *** -- pinskia at gcc dot gnu dot org changed: What|Removed |Added CC||sirl at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14366
Re: [Bug c/14366] variable previously declared `static' redeclared `extern' is valid ISO C - 3.4 and 4.0 regression
pinskia at gcc dot gnu dot org wrote:- Hmm, I think this causes the following invalid code to be accepted (but I am not sure if this is invalid code or not): enum in_section { in_toc }; int f(void) { extern int in_toc; } -- In 3.3 and before we got: t1.c: In function `f': t1.c:1: error: `in_toc' redeclared as different kind of symbol t1.c:1: error: previous declaration of `in_toc' I believe this should be accepted. Either way in_toc is not redeclared, there is only one declaration at block scope and that hides the outer declaration. More serious is the fact that a missing return statement is apparently not diagnosed?
[Bug c/14366] variable previously declared `static' redeclared `extern' is valid ISO C - 3.4 and 4.0 regression
--- Comment #7 from neil at daikokuya dot co dot uk 2006-05-18 22:22 --- Subject: Re: variable previously declared `static' redeclared `extern' is valid ISO C - 3.4 and 4.0 regression pinskia at gcc dot gnu dot org wrote:- Hmm, I think this causes the following invalid code to be accepted (but I am not sure if this is invalid code or not): enum in_section { in_toc }; int f(void) { extern int in_toc; } -- In 3.3 and before we got: t1.c: In function `f': t1.c:1: error: `in_toc' redeclared as different kind of symbol t1.c:1: error: previous declaration of `in_toc' I believe this should be accepted. Either way in_toc is not redeclared, there is only one declaration at block scope and that hides the outer declaration. More serious is the fact that a missing return statement is apparently not diagnosed? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14366
[Bug c/14366] variable previously declared `static' redeclared `extern' is valid ISO C - 3.4 and 4.0 regression
--- Comment #6 from pinskia at gcc dot gnu dot org 2006-05-17 18:29 --- Hmm, I think this causes the following invalid code to be accepted (but I am not sure if this is invalid code or not): enum in_section { in_toc }; int f(void) { extern int in_toc; } -- In 3.3 and before we got: t1.c: In function `f': t1.c:1: error: `in_toc' redeclared as different kind of symbol t1.c:1: error: previous declaration of `in_toc' -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14366