This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: g++ exception


The -v -Q suggestion has been very helpful.  It let us find where in our code the
compiler was choking and then, by selectively commenting out code in the function(s),
find the line(s) causing g++ to crash.

The first line of code causing problems was:
	(m_pXpt->b_cancel) (m_cmds + i, &dCancel) ;

where m_pXpt is a pointer to a class object and b_cancel() is a simple class member
function.  Removing the superfluous parens, so the line looks like this
	m_pXpt->b_cancel (m_cmds + i, &dCancel) ;

gets g++ past this problem.  Then there were two instances of code like this
	if (m_pXpt->b_session_status != 0)

again where m_pXpt is a pointer to a class object and b_session_status is a simple
class member function.  Note this is not calling the method, but just testing if the address
of the function is != 0.  This might be a little unclear, so the declarations look like this
	class Foo {
	public:
		void b_session_status();
	} * m_pXpt;

As I understand C++, the expression 'm_pXpt->b_session_status' is type 'pointer to member
function' and should always be non-zero.  We just removed this strange code to resolve the
issue.

I tried to make a small test file to make it easy to reproduce the problem, but the small
test file compiled just fine.

I see two outstanding problems (which I will do my best to look into):
1.  The above (yucky) code should compile.  It is not clear if this is a cygwin32 or g++
	problem.  I thought I would try to compile the file under linux to see if g++
	chokes there also.
2.  When cc1plus traps a signal it should not go into an infinite loop.

Thanks for your help,
Brian Beuning
  
  

----------
From: 	Fergus Henderson
Sent: 	Saturday, April 26, 1997 2:00 AM
To: 	Brian Beuning <BrianB@atl.paysys> com@cygnus.com
Cc: 	Cygnus GNU-win32 mailing list
Subject: 	Re: g++ exception

Brian Beuning <BrianB@atl.paysys>, com@cygnus.com, you wrote:
> 
> We are trying to compile our project with gnu-win32.  Most of the files
> look like they will compile except one file which always causes the
> compiler to die with lines like this:
> 
> (C:\cygnus\H-I386-CYGWIN32\lib\gcc-lib\i386-cygwin32/cygnus-2.7.2-961023/cc1plus.exe 1034) In cygwin_except_handler
> 
> The compiler does not print any other errors before these start coming out.

Try compiling with `-v -Q'.  That will get gcc to print out the name of
each function as it is compiling it, so you will be able to see which
function is triggering the problem.

-- 
Fergus Henderson <fjh@cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh@128.250.37.3         |     -- the last words of T. S. Garp.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]