This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Static unsized arrays (is this a bug)


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]