Menu

#1 Check return codes everywhere

open
nobody
None
5
2007-03-11
2007-03-08
No

Some checks for return codes are missing.

Examples:
Would you like to add more error handling for return values from "malloc" in functions like "HC_complex_phase_vocoder" and "pv_loose_lock"?
http://waon.cvs.sourceforge.net/waon/waon/hc.c?revision=1.5&view=markup
http://waon.cvs.sourceforge.net/waon/waon/pv-loose-lock.c?revision=1.6&view=markup
http://www.gtk.org/api/2.6/glib/glib-Memory-Allocation.html

Discussion

  • Kengo Ichiki

    Kengo Ichiki - 2007-03-10
    • status: open --> closed
     
  • Kengo Ichiki

    Kengo Ichiki - 2007-03-10

    Logged In: YES
    user_id=1602015
    Originator: NO

    Hi Markus, Thanks for your post. Now it is done. See CVS.

     
  • Markus Elfring

    Markus Elfring - 2007-03-11
    • status: closed --> open
     
  • Markus Elfring

    Markus Elfring - 2007-03-11

    Logged In: YES
    user_id=572001
    Originator: YES

    Would you like to fix more unchecked function calls?
    - close
    - fprintf
    - read
    http://waon.cvs.sourceforge.net/waon/waon/midi.c?revision=1.4&view=markup

    How do you think about to detect every error situation as early as possible?

     
  • Nobody/Anonymous

    Logged In: NO

    Hi Markus, Can you be more specific? Theoretically it is better checking everything whenever available. Practically I sometime skip something, 'cause I want to spend more time on others like to add functions and to improve the quailty. If you met any real BUG situation, give me the situation. Thanks. Kengo

     
  • Markus Elfring

    Markus Elfring - 2007-03-12

    Logged In: YES
    user_id=572001
    Originator: YES

    1. Does any unchecked write call affect code quality?

    2. Can the tool "http://splint.org/" help?

    3. Would you like to use exception handling?
    http://www.dietmar-kuehl.de/mirror/c++-faq/exceptions.html#faq-17.1

     

Log in to post a comment.

Auth0 Logo