Date: Mon, 5 Aug 1996 13:20:45 BST From: "C. N. Feng" Subject: Re: Internal compiler error, Help! To: DJGPP Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII On Thu, 1 Aug 1996 13:48:52 +0300 (GMT) Salvador Eduardo Tropea (SET) wrote: > > Hi Feng: > > >"C. N. Feng" wrote: > >>Hi, > >>I encountered an "Internal compiler error". But I cannot see any wrong with my code. > >There you go - it's not your fault, it's GNUs. Send this message to > >the address they mention and see what happens. > >As a temporary fix, try just rearranging your function - keep it doing > >the same thing, in slightly different ways, to avoid this compiler > >bug. Perhaps they'd like it if you sent the rearrangement that worked > >to the above address as well... it might help in killing the bug? > > Are you using Windows or CWSDPMI? Some versions of CWSDPMI don't support lotz > malloc calls and the compiler use to crash with this stupid message. > Are you trying to put a really huge static array in your code? Another weak > point of the package. > Do you have the default 256Kb stack size? some people use more. > If you allready checked all of this send the bug report to the GNU people. > > bye SET > Thanks for all your suggestions. I think I found the problem that is you cannot use the exceptions in a base class. I don't know whether it is a bug or an unsported feature. An example is followed. Feng, Cheng-Ning // ************************************************************************ #include #include class Ele { public: Ele(); ~Ele(); Ele& Setup(int n); private: int *data; }; Ele::Ele():data(NULL){} Ele::~Ele(){ delete [] data;} Ele& Ele::Setup(int n) { try { data=new int[n]; if(!data) throw("error in locate memory of class Ele"); } catch(char *error) { cerr<