This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/22556] New: extern array: compatible declaration at function scope refused
- From: "SWElef at post dot sk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Jul 2005 09:00:13 -0000
- Subject: [Bug c++/22556] New: extern array: compatible declaration at function scope refused
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
extern int foo[]; // OK
int foo[]={1,2,3};
extern int foo[]; // OK
void bar(){
extern int foo[]; // g++: ERROR -- SHOULD BE OK
}
g++ 3.4.0, 3.4.3, 4.0.0 (cygwin), g++ 3.4.2 (mingw):
xxx.cpp: In function 'void bar()':
xxx.cpp:6: error: type mismatch with previous external decl of 'int foo []'
xxx.cpp:2: error: previous external decl of 'int foo [3]'
g++ 3.3.1, 3.3.2 (cygwin) issue a slightly different error message
This may be related to PRs 21342 and 21502.
Vladimir Marko
--
Summary: extern array: compatible declaration at function scope
refused
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: SWElef at post dot sk
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22556