From: "Oleh Derevenko" <o...@eleks.lviv.ua>
Date: Sat, 22 Mar 2008 17:10:31 +0200
Local: Sat, Mar 22 2008 11:10 am
Subject: Re: [ode-users] errorchecking branch
1) It is incorrect to replace ASSERT with return 0. If code does not expect
NULL-pointer it will not do any good to just return because further code in caller may not be able to handle that invalid return. Each such assert must be checked. You must verify all the places the function could be called from and make sure the caller can handle that invalid result. Do you realize what amound of work is that? That is monotonous work that makes you tired very soon. Can you predict how many errors you'll make? 2) ASSERT is written in all uppercase to distinguish it from ordinary functions. It shows you immediately, that ASSERT is not a function but a macro and its behavior may change or it may be removed from code. Changing case to function-like makes code much more unclear. 3) Returns from inside of the function are the bad style. They lead to potential bugs. Especially dangerous are returns hidden in macros and especially when those macros look like functions. My resume: Oleh Derevenko ----- Original Message -----
From: "Daniel K. O." <danielko.lis...@gmail.com> To: <ode-users@googlegroups.com> Sent: 22 березня 2008 р. 16:18 Subject: [ode-users] errorchecking branch > So I just just created the errorchecking branch, where I'm adding the > Currently I'm just replacing dAASSERT() and some dUASSERT() with > There are 3 behaviors: > Currently only ode.cpp was updated, so I would like to ask for comments > PS: As this will touch a ton of lines, I started adding modelines to the > -- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||