Subject: RE: g++ exception
From: Brian Beuning <[email-masked]>, [email-masked]

29 Apr 1997 15:29:09 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <01BC54AF.7A6E4BF0.cygnus.gnu-win32@BRIANB>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Original-To: "Brian Beuning <[email-masked]> [email-masked]" <[email-masked]>,
        "'Fergus Henderson'" <[email-masked]>
Original-Cc: Cygnus GNU-win32 mailing list <[email-masked]>
Original-Sender: [email-masked]

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 <[email-masked]> [email-masked]
Cc: 	Cygnus GNU-win32 mailing list
Subject: 	Re: g++ exception

Brian Beuning <[email-masked]>, [email-masked], 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 <[email-masked]>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger [email-masked]         |     -- the last words of T. S. Garp.
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".