public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/34119] New: gcc incorrectly allows constant zero-sized array
@ 2007-11-16 14:34 kkoehne at trolltech dot com
2007-11-16 15:12 ` [Bug c++/34119] " pcarlini at suse dot de
0 siblings, 1 reply; 2+ messages in thread
From: kkoehne at trolltech dot com @ 2007-11-16 14:34 UTC (permalink / raw)
To: gcc-bugs
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c++/34119] gcc incorrectly allows constant zero-sized array
2007-11-16 14:34 [Bug c++/34119] New: gcc incorrectly allows constant zero-sized array kkoehne at trolltech dot com
@ 2007-11-16 15:12 ` pcarlini at suse dot de
0 siblings, 0 replies; 2+ messages in thread
From: pcarlini at suse dot de @ 2007-11-16 15:12 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pcarlini at suse dot de 2007-11-16 15:12 -------
3.4.x is not maintained anymore. Otherwise, -pedantic is enough.
--
pcarlini at suse dot de changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Known to work| |4.1.3 4.2.1 4.3.0
Resolution| |WORKSFORME
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34119
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-11-16 15:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-16 14:34 [Bug c++/34119] New: gcc incorrectly allows constant zero-sized array kkoehne at trolltech dot com
2007-11-16 15:12 ` [Bug c++/34119] " pcarlini at suse dot de
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).