From: Jason Green Newsgroups: comp.os.msdos.djgpp Subject: Re: Help... classes and optimization problem Date: Sun, 27 May 2001 10:06:27 +0100 Lines: 20 Message-ID: <7tf1htc7im4vmtto3ve7eqmmjs6frns4ue@4ax.com> References: NNTP-Posting-Host: modem-63.erythromycin.dialup.pol.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news6.svr.pol.co.uk 990954378 3001 62.136.93.63 (27 May 2001 09:06:18 GMT) NNTP-Posting-Date: 27 May 2001 09:06:18 GMT X-Complaints-To: abuse AT theplanet DOT net X-Newsreader: Forte Agent 1.7/32.534 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Vermin" wrote: > OK...there might be somer errors there, but I hope you get the point... So > when I use the class in the following way, everything works fine: > > something s; > s.HandleString("Angel!"); > > ..but I get a "general protection fault" error when I use the following > code: > > something s("Angel!"); > > ..and this is only when optimization is turned on (-O2 or -O3). What might > be wrong? Any suggestions? What happens if you do: char str[256] = "Angel!"; something s (str);