delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/14/08:21:58

Message-Id: <3.0.2.32.19981014142030.007085e0@tex.odd.it>
X-Sender: delfo AT tex DOT odd DOT it
X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.2 (32)
Date: Wed, 14 Oct 1998 14:20:30 +0200
To: djgpp AT delorie DOT com
From: Stefano Del Furia <delfo AT tech-center DOT com>
Subject: error Abort ! with Gcc and vector <> AND optimizations
Mime-Version: 1.0
Reply-To: djgpp AT delorie DOT com

Hi all,
i'm try to compile the following file
with Gnu Cpp for ms-dos. latest version.

#include <vector.h>

class Obj {
	private:
		long int lCodeObj;
	public:
		Obj();
};

inline Obj::Obj()
{
lCodeObj=1;
};

// if include the line below there's : Abort ! error
// with -O or -O1
// works fine with -O2 end above or with no optimization
vector <Obj> VObjs(10);

// This works fine
vector <int> Vint(10);

int main()
{
return 0;
}

Like explained in the source, the line
vector <Obj> VObjs(10);
cause an Abort ! Error if compiled with Gcc optimizations options set to -O
-O1 while all seems works with Gcc optimizations options set to -O2 -O3
ecc. or without optimizations.
The line
vector <Obj> VObjs;
without specify the size, is compiled perfectly in every case.
A note.
The line 
VObjs.resize(10);
cause the same compilation error.
TIA

 >>mailed by                              ''~``
 Stefano Del Furia                       ( o o )
  __________________________________.oooO--(_)--Oooo._
 | ___/ / _/__ www.geocities.com/SiliconValley/3546/  |
 |/ _  / _(_-< Computer Science Department            |
 |\_,_/_//___/ delfo AT tech-center DOT com  .oooO           |
 |ITIS "E.FERMI" Bibbiena 52010 AR IT (   )   Oooo.   |
 |_____________________________________\ (____(   )___| 
 THEORY is when you know everything     \_)    ) /
        but nothing works.                    (_/
 PRACTICE is when everything works
        but you don't know why.
 Our aim is to join THEORY and PRACTICE:
 (-: NOTHING works and we don't know WHY :-)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019