documenting exceptions

Discussion in 'C++' started by Ian Lazarus, May 26, 2004.

  1. Ian Lazarus

    Ian Lazarus Guest

    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
     
    Ian Lazarus, May 26, 2004
    #1
    1. Advertising

  2. 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
     
    Steven T. Hatton, May 26, 2004
    #2
    1. Advertising

  3. Ian Lazarus

    Ian Lazarus Guest

    If I was a good programmer, I'd write the tool myself.
     
    Ian Lazarus, May 26, 2004
    #3
  4. Ian Lazarus

    Mike Smith Guest

    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
     
    Mike Smith, May 26, 2004
    #4
  5. 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
     
    Steven T. Hatton, May 26, 2004
    #5
  6. 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/commands.html#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
     
    Steven T. Hatton, May 26, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tim Almond

    Documenting ASP.NET

    Tim Almond, Jul 11, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    463
    Kevin Spencer
    Jul 12, 2003
  2. Ahmed Moustafa
    Replies:
    5
    Views:
    30,069
    Chris Smith
    Jul 14, 2004
  3. Paul Miller
    Replies:
    3
    Views:
    1,031
    Alex Martelli
    Nov 12, 2003
  4. Replies:
    3
    Views:
    619
    Sherm Pendley
    Apr 16, 2007
  5. Lie
    Replies:
    3
    Views:
    645
Loading...

Share This Page