public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/17179] New: g++ miscompiles arrays initialized with compound literals
@ 2004-08-25  2:21 anders at kaseorg dot com
  2004-08-25  4:09 ` [Bug c++/17179] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: anders at kaseorg dot com @ 2004-08-25  2:21 UTC (permalink / raw)
  To: gcc-bugs

The following program:

#include <stdio.h>
static int y[] = (int []) {1, 2, 3};
int main ()
{
    printf ("%d %d %d\n", y[0], y[1], y[2]);
}

gives "1 2 3" when compiled with gcc, but it gives "0 0 0" when compiled with
g++. I'm using gcc-3.3.3-7 on Fedora Core 2.

My friend using gcc-3.4.1-r2 on Gentoo reports that the same program causes g++
to segfault.

-- 
           Summary: g++ miscompiles arrays initialized with compound
                    literals
           Product: gcc
           Version: 3.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: anders at kaseorg dot com
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i386-redhat-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17179


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-08-25 12:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-25  2:21 [Bug c++/17179] New: g++ miscompiles arrays initialized with compound literals anders at kaseorg dot com
2004-08-25  4:09 ` [Bug c++/17179] " pinskia at gcc dot gnu dot org
2004-08-25  4:54 ` pinskia at gcc dot gnu dot org
2004-08-25 12:37 ` bangerth at dealii dot org

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).