Using gcc for C++ backend to checking exceptions?

Marc Waeckerlin Marc.Waeckerlin@siemens.com
Mon Jun 30 15:07:00 GMT 2003


Hi,

In C++, the use of exceptions is dangerous because it is (other than in 
Java) not necessarily documented, who throws what. The "throw()" 
declaration in the interface is optional and no declaration 
unfortunately means anything can be thrown. In a large project, 
exceptions are often accidentally not catched, or "throw()" declarations 
are forgotten (even if required by the coding rules) or simply wrong 
(declared to throw class A, but throws class B).

This would be an typical job for a gcc backend, to check whether all 
exceptions thrown are declared in the interface. This way, "unexpected" 
cannot occur any more, and you can be sure that no one forgot to catch 
an exception (because he declared that he (re-) throws it).

I don't think that I am the only one with this idea, but I did not find 
anything on the internet. That's why I'd like to ask you the following 
questions:
 - Is there a similar project already started?
 - Would you support me if I'd start it?
 - Is there a way to register such a project at GNU?
 - What documentation would be helpful for me?

I found this e-mail address in the "gcc internals".

Thank you
Regards
Marc

-- 
Siemens Schweiz AG, ES12 / I-49
Marc Wäckerlin 
Albisriederstrasse 245, CH-8047 Zürich
Telefon: ++41 58 558 32 29
mailto:Marc.Waeckerlin@siemens.com
http://www.siemens.ch




More information about the Gcc mailing list