CYGNUS-WIN32-b17.1 ERROR MESSAGE LOOP-BUG

Tage Westlund tage.westlund@stockholm.mail.telia.com
Sun Mar 16 09:39:00 GMT 1997


// 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!
//
// <tage.westlund@stockholm.mail.telia.com>
// ------------------------------------------------------------

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 <stream.h>
#include <iostream.h>
#include <fstream.h>
#include <strstream.h>
#include <iomanip.h>

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@cygnus.com" with one line of text: "help".



More information about the Cygwin mailing list