This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Static unsized arrays (is this a bug)
- From: Leon Bottou <leonb at research dot nj dot nec dot com>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 10 Oct 2002 11:47:23 -0400
- Subject: Static unsized arrays (is this a bug)
- Reply-to: leonb at research dot nj dot nec dot com
This used to work with g++-2.95.
------- begin file array.cpp
struct foo { int a; int b; };
static foo f1[];
static foo f1[] = {1,2};
------- end file array.cpp
$ g++ -c array.cpp
array.cpp:2: array size missing in `f1'
array.cpp:3: redefinition of `foo f1[]'
array.cpp:2: `foo f1[1]' previously declared here
Note that the following works as expected:
------- begin file array2.cpp
struct foo { int a; int b; };
extern foo f1[];
foo f1[] = {1,2};
------- end file array2.cpp
- Leon Bottou