Adding to G++: Adding a warning on throwing unspecified exceptions.

Jonathan Wakely
Sat Sep 27 02:15:00 GMT 2008

2008/9/24 Simon Hill:
> Brain Dessent wrote:
>> You're essentially trusting that all
>> exception specifiers for every function in the program and *all* library
>> code are always present and always correct which is a huge leap of faith
>> that I don't think is supported by reality.
> I agree that it won't be very useful initially due to lots of third
> party code like boost neither defining nor adhering exception
> restrictions 100% of the time (STL may be guilty also). However, this
> is a catch 22. Why not provide the mechanism for verifying exception
> specifications so that these libraries can, in future, become fully
> compliant?

That won't happen. Boost and the standard library are not "guilty" of
anything. The standard library components *are* fully compliant to the
ISO standard by definition, and the omission of exception
specifications is (in almost all cases) completely intentional.

Some people might find the warning useful, but please don't assume
that code without exception specifications is incomplete, or would
necessarily benefit from having them.


More information about the Gcc mailing list