public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13574] New: array default initializer in class lets gcc consume all memory and die
@ 2004-01-05 23:09 pabel at iam dot uni-bonn dot de
  2004-01-05 23:45 ` [Bug c++/13574] [3.3/3.4 Regression] " pinskia at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: pabel at iam dot uni-bonn dot de @ 2004-01-05 23:09 UTC (permalink / raw)
  To: gcc-bugs

When trying to compile this program 
--- 
class A { 
  public: 
#ifdef SAFE 
    A() : argc(0) {  }; 
#else 
    A() : argc(0), argv() {  }; 
#endif 
  private: 
    int argc; 
    char* argv[]; 
}; 
 
int main() { 
    A y; 
} 
--- 
with g++ without -DSAFE, the compiler consumes all memory until it chokes: 
g++ argv.cpp -o argv -Wall 
virtual memory exhausted: Cannot allocate memory 
 
It does not happen when using "char**" as type. 
 
some info: 
 
uname -a  
Linux operator 2.4.20-4GB #1 Wed Oct 29 22:20:11 CET 2003 i686 i686 i386 
GNU/Linux 
 
g++ -v 
Reading specs from /usr/lib/gcc-lib/i586-suse-linux/3.3.1/specs 
Configured with: ../configure --enable-threads=posix --prefix=/usr 
--with-local-prefix=/usr/local --infodir=/usr/share/info 
--mandir=/usr/share/man --libdir=/usr/lib 
--enable-languages=c,c++,f77,objc,java,ada --disable-checking --enable-libgcj 
--with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib --with-system-zlib 
--enable-shared --enable-__cxa_atexit i586-suse-linux 
Thread model: posix 
gcc version 3.3.1 (SuSE Linux)

-- 
           Summary: array default initializer in class lets gcc consume all
                    memory and die
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pabel at iam dot uni-bonn dot de
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: Linux 2.4.20-4GB i686


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


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

end of thread, other threads:[~2004-01-21  8:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-05 23:09 [Bug c++/13574] New: array default initializer in class lets gcc consume all memory and die pabel at iam dot uni-bonn dot de
2004-01-05 23:45 ` [Bug c++/13574] [3.3/3.4 Regression] " pinskia at gcc dot gnu dot org
2004-01-10 22:11 ` pinskia at gcc dot gnu dot org
2004-01-10 22:18 ` hubicka at gcc dot gnu dot org
2004-01-16 17:50 ` mmitchel at gcc dot gnu dot org
2004-01-16 19:28 ` cvs-commit at gcc dot gnu dot org
2004-01-16 19:28 ` [Bug c++/13574] [3.3 " mmitchel at gcc dot gnu dot org
2004-01-16 19:33 ` pinskia at gcc dot gnu dot org
2004-01-21  8:06 ` cvs-commit at gcc dot gnu dot org
2004-01-21  8:07 ` gdr at gcc dot gnu 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).