From: tage DOT westlund AT stockholm DOT mail DOT telia DOT com (Tage Westlund) Subject: CYGNUS-WIN32-b17.1 ERROR MESSAGE LOOP-BUG 16 Mar 1997 11:47:58 -0800 Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <332C4968.1AE.cygnus.gnu-win32@stockholm.mail.telia.com> Reply-To: tage DOT westlund AT stockholm DOT mail DOT telia DOT com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.0 (Win95; I) Original-To: gnu-win32 AT cygnus DOT com Original-CC: tage DOT westlund AT stockholm DOT mail DOT telia DOT com Original-Sender: owner-gnu-win32 AT cygnus DOT com // TO THE CYGWIN32 DESIGNERS! A BUG REPORT FOLLOWS. // I have an IBM cloned PC with Win95 and the binary version // of cygnus-win32-b17.1 ( 2.7.2-961023 ) // ------------------------------------------------------------ // I want to push a little for the opinion that those rather // frequent enless loops are serious bugs. Specially in con- // junction with the well known CTRL+C bug it is irritating. // A compiler should behave like a patient teacher which does // not rush out of the classroom when the student makes a // foolish error. It took me hours to find the error below, // buried as it was in a large code volume and with diffi- // culties in reading the beginning of the error report. // You always think the problem is sophisticated, not trivial. // Please do not misunderstand me; I am otherwise a happy // supporter of this free software. Thank you that have made it! // ------------------------------------------------------------ // A "case" where an endless error report loop results from // using "{" instead of ";" This may be more frequent than // expected at a first glance. You often move the prototype // xxx(int a); from the method definition xxx(int a){... } // I wanted to reduce the code as much as possible but still // having the loop error preserved. Because of that, if you // correct the error you will have "ordinary", stable error // messages. The original class code is without errors. // Best Regards! // // // ------------------------------------------------------------ class Dis { public: Dis(int=4,int=6,int=20,char='.'); void show(Dis&, vedTextEditor*); // ############################################################### void coutPut1(vedTextEditor*,char*,int){ // ############ Above is the catastrophy ##################### private: int column,row,wid,siz,widpos,*pwid; char bgr,*arr,*beg,*cur,*end; vedCmdWindow* vCW; vedTextEditor* vedCan; }; // This is the list Dis.C of member functions of class Dis // --------------------------------------------------------- #include #include #include #include #include Dis::Dis(int colu,int ro,int wi,char bg) { column=colu; row=ro; wid=wi; pwid=&wid; bgr=bg; siz=colu*ro*wi; arr=new char[siz+1]; end=arr+siz; // This is pointer arithmetics beg=cur=arr; char *ptr; ptr=arr; while(ptr != end)*ptr++=bgr; // set background char. *ptr='\0'; // end of string mark } // ---------------- void Dis::show(Dis& disx, vedTextEditor* vedCan) { disx.coutPut1(vedCan,cur,1); } // ---------------- void Dis::coutPut1(vedTextEditor* vedCan,char* pobuff,int contr){ static char buff[300], *poi; if(contr==1){ poi=&buff[0]; return; } } // ---------------- - For help on using this list, send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".