Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > documenting exceptions

Reply
Thread Tools

documenting exceptions

 
 
Ian Lazarus
Guest
Posts: n/a
 
      05-26-2004
Hello,
Are you aware of any tool which analyzes source code and documents the
exceptions thrown for each routine in each source file for a project?
Thanks


 
Reply With Quote
 
 
 
 
Steven T. Hatton
Guest
Posts: n/a
 
      05-26-2004
Ian Lazarus wrote:

> Hello,
> Are you aware of any tool which analyzes source code and documents the
> exceptions thrown for each routine in each source file for a project?
> Thanks


This is one of the main reasons I don't like C++ exception syntax. I
understand there are legacy issues, but the fact that exceptions
potentially thrown by a function are not required to be part of the
signature bothers me. I believe the tool you are looking for is called a
good programmer.

--
STH
Hatton's Law: "There is only One inviolable Law"
KDevelop: http://www.kdevelop.org SuSE: http://www.suse.com
Mozilla: http://www.mozilla.org
 
Reply With Quote
 
 
 
 
Ian Lazarus
Guest
Posts: n/a
 
      05-26-2004
If I was a good programmer, I'd write the tool myself.


 
Reply With Quote
 
Mike Smith
Guest
Posts: n/a
 
      05-26-2004
Ian Lazarus wrote:

> If I was a good programmer, I'd write the tool myself.


The obvious place to start is to do a text search on a .cpp file for
"throw" (ignoring comments), and then for each one found, search
backward to find the function body. That alone will tell you which
functions throw, and where the throws occur.

--
Mike Smith

 
Reply With Quote
 
Steven T. Hatton
Guest
Posts: n/a
 
      05-26-2004
Ian Lazarus wrote:

> If I was a good programmer, I'd write the tool myself.

Sorry, I think that came across wrong. I was only suggesting that the only
way to effectively accomplish your goal is to be sure the code was written
by a programmer who understands C++ exceptions, and /does/ explicitly add
the exceptions to the declarations. I was assuming you were not only
asking about code you had written, but also about code that was written by
others. I did not intend to imply you are not qualified to do so.
--
STH
Hatton's Law: "There is only One inviolable Law"
KDevelop: http://www.kdevelop.org SuSE: http://www.suse.com
Mozilla: http://www.mozilla.org
 
Reply With Quote
 
Steven T. Hatton
Guest
Posts: n/a
 
      05-26-2004
Ian Lazarus wrote:

> Hello,
> Are you aware of any tool which analyzes source code and documents the
> exceptions thrown for each routine in each source file for a project?
> Thanks

Have you looked at Doxygen? I really don't know what it might to for you,
but it's the best bet I know of:
http://www.stack.nl/~dimitri/doxygen...l#cmdexception

And there's always:
"TODO/Wish list

"Here is a list of things that may be added in the future. As you can see,
there are way too many things on the list for me to do in any reasonable
amount of time! So if you'd like to implement one or more of these features
for me, please let me know! "

http://www.stack.nl/~dimitri/doxygen/todo.html
--
STH
Hatton's Law: "There is only One inviolable Law"
KDevelop: http://www.kdevelop.org SuSE: http://www.suse.com
Mozilla: http://www.mozilla.org
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exceptions - How do you make it work like built-in exceptions? Lie Python 3 01-14-2008 06:45 PM
Exceptions + Performance on path without exceptions gratch06@gmail.com C++ 3 04-16-2007 08:52 PM
Checked exceptions vs unchecked exceptions Ahmed Moustafa Java 5 07-14-2004 01:46 PM
Custom exceptions -- inherit from exceptions.Exception? Paul Miller Python 3 11-12-2003 09:24 AM
Documenting ASP.NET Tim Almond ASP .Net 1 07-12-2003 03:21 PM



Advertisments