Exception Specifications

Martin York martin_york@symantec.com
Wed Dec 6 14:50:00 GMT 2006


 

Hope I am not stepping into a religious war but.

I think the general consensus is that it is not a good idea to use
exception specification on functions/methods. My main objection is that
I do not want an unexpected exception to make the application exit with
a call to 'unexpected()'.

I think Hurb Sutter summaries the point well (an more eloquently that I)
on this page:
http://www.gotw.ca/gotw/082.htm (see section 4)


Martin.



-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
Behalf Of Perry Smith
Sent: Wednesday, December 06, 2006 9:27 AM
To: MSX to GCC
Subject: Exception Specifications

I believe I saw in some of the boost libraries that they do not use
exception specifications because some compilers produce slower code.

I'm considering adding exception specifications to most/all of my
functions -- mostly for my own sake.  But I'm wondering how it will
affect the compiler's generated code.  (i.e. if it is going to affect
performance, I can put the exception specifications in comments just as
easily).  I'm currently using gcc 4.0.2.

Thank you,
Perry Smith ( pedz@easesoftware.com )
Ease Software, Inc. ( http://www.easesoftware.com )

Low cost SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems





More information about the Gcc-help mailing list