This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Using gcc for C++ backend to checking exceptions?


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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]