Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gcc 3.3 try - catch -finally



Marc Poirier wrote:
| Drat, when I read your message subject, I thought you were going to be
| talking about how try and catch "finally work" in gcc 3.3 C++.

They work in gcc 3.1; I use them regularly. Did they get broken in 3.3?

| [S]houldn't something like this for example, if gcc's exception
| handling were working correctly, result in the message being printed
| to console:
|
| typedef void * (*generic_function)();
| try {
| generic_function fptr = (generic_function) rand();
| fptr();
| }
| catch (...) {
| printf("whoa hey, we have an exception!\n");
| }
|
| For me the catch (...) part is never hit...

I wouldn't expect that code to throw an exception, so I'm not surprised that the catch block isn't executed. Rand() is a C function, and C functions don't throw exceptions. Why do you expect that an exception would be thrown?

Glen Fisher
_______________________________________________
projectbuilder-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/projectbuilder-users
Do not post admin requests to the list. They will be ignored.

References: 
 >gcc 3.3 try - catch -finally (From: Marc Poirier <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.