Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Version 3 and Version 4 of code/Error_handling


Ignore:
Timestamp:
Nov 12, 2008, 8:56:43 AM (16 years ago)
Author:
dafrick
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • code/Error_handling

    v3 v4  
    3535}}}
    3636
    37 You can now insert a call to the 'asser()' macro so that whenever ptr == 0 the program aborts. Now this doesn't sound very help, but it is: First of all, the abort message tells you exactly where the error has happened (file, line, function). Secondly, the program would have aborted anyway because of the null pointer. [[br]][[br]]
     37You can now insert a call to the 'asser()' macro so that whenever ptr == 0 the program aborts. Now this doesn't sound very helpful, but it is: First of all, the abort message tells you exactly where the error has happened (file, line, function). Secondly, the program would have aborted anyway because of the null pointer. [[br]][[br]]
    3838The more asserts you insert, the easier bug tracking will be. You might even spot them before they could ever be triggered. [[br]][[br]]
    3939'''Important: Asserts are only useful when the mistake is in the program. Throwing asserts for bad input doesn't help anyone, use exceptions then! [[br]]