delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/04/29/15:29:09

From: Brian Beuning <BrianB AT atl DOT paysys>, com AT cygnus DOT com
Subject: RE: g++ exception
29 Apr 1997 15:29:09 -0700 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <01BC54AF.7A6E4BF0.cygnus.gnu-win32@BRIANB>
Mime-Version: 1.0
Original-To: "Brian Beuning <BrianB AT atl DOT paysys> com AT cygnus DOT com" <BrianB AT atl DOT paysys>,
"'Fergus Henderson'" <fjh AT cs DOT mu DOT OZ DOT AU>
Original-Cc: Cygnus GNU-win32 mailing list <gnu-win32 AT cygnus DOT com>
Original-Sender: owner-gnu-win32 AT cygnus DOT com

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 AT atl DOT paysys> com AT cygnus DOT com
Cc: 	Cygnus GNU-win32 mailing list
Subject: 	Re: g++ exception

Brian Beuning <BrianB AT atl DOT paysys>, com AT cygnus DOT 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 AT cs DOT mu DOT oz DOT 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 AT 128 DOT 250 DOT 37 DOT 3         |     -- the last words of T. S. Garp.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".


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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019