Message-ID: <38B5A8F2.943DAB97@netcom.ca> From: MM X-Mailer: Mozilla 4.5 [en] (Win95; I) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: Possible Compiler Bug References: <38B57379 DOT 817FFBE4 AT netcom DOT ca> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 37 Date: Thu, 24 Feb 2000 16:56:02 -0500 NNTP-Posting-Host: 216.123.36.35 X-Complaints-To: abuse AT netcom DOT ca X-Trace: tor-nn1.netcom.ca 951429156 216.123.36.35 (Thu, 24 Feb 2000 16:52:36 EDT) NNTP-Posting-Date: Thu, 24 Feb 2000 16:52:36 EDT Organization: Netcom Canada To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Thanks for the reply Jason. Yes, I am using a slightly older version of gcc, Ii'll update ASAP. But everything in the code, up to but not including, the this->funcptr() call should be valid since it was basically taken from a C++ faq (not Bob's C++ faq, but a widely distributed one). I'll look into other forms of accomplishing my task, but so far I haven't been able to come up with anything as efficient as this is. Thanks for your help. Jason Green wrote: > MM wrote: > > > The file I've attached causes djgpp to kill the compiler and tell me to > > submit a full bug report. I would do so, but first I want to make sure > > this happens to others as well. If you could please take a look at the > > code and tell me what I'm doing wrong or if it shouldn't be done like > > that at all to begin with I'd greatly appreciate it. > > Thanks, > > If gcc says to submit a bug report then that is by itself fair > confirmation that you have found a bug. ;-/ If you would like > confirmation from others then please give the exact compile line you > use, also say what version of gcc. > > I have tried to replicate the problem, but all I get are compiler > errors about the code. The is with gcc 2.95.2, maybe you have an > older version and the bug is already fixed? > > As to whether what you are doing is ok or not, well I get compile > errors so that should tell you something ;-) I don't understand what > you are trying to do, but I would point out that in C++ there are > better ways of doing some things that would require function pointers > in C. Maybe you want to investigate derived classes, function > overloading and virtual functions? > > Of course, whether or not the code is legal, and whether or not the > style is Good, the compiler should not crash.