By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,804 Members | 1,659 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,804 IT Pros & Developers. It's quick & easy.

documenting exceptions

P: n/a
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
Jul 22 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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
Jul 22 '05 #2

P: n/a
If I was a good programmer, I'd write the tool myself.
Jul 22 '05 #3

P: n/a
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

Jul 22 '05 #4

P: n/a
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
Jul 22 '05 #5

P: n/a
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
Jul 22 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.