const int foo[] = {}; should be an error according to the ISO:ANSI standard:
"An array of unknown size initialized with a brace-enclosed initializer-list containing n initializers, >>>where n shall be greater than zero<<<, is defined as having n elements" http://www.kuzbass.ru:8086/docs/isocpp/decl.html , Section 8.5.1.6 However, gcc compiles it without any errors/warnings, even with -ansi -pedantic. -- Summary: gcc incorrectly allows constant zero-sized array Product: gcc Version: 3.4.4 Status: UNCONFIRMED Severity: minor Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: kkoehne at trolltech dot com GCC host triplet: CYGWIN_NT-6.0 GCC target triplet: CYGWIN_NT-6.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34119