|
From: Nicholas N. <nj...@ca...> - 2004-07-01 13:12:22
|
On Tue, 29 Jun 2004, Jeremy Fitzhardinge wrote:
>> Hmm, on one hand I agree, but on the other hand I'm not so sure -- since
>> we are using our own vg_assert() which is never turned off... how would a
>> new syscall-retval-checking function be any different, other than not
>> having "assert" in the name? I guess the short question is: what's the
>> definition of "assert-style"?
>
> Well, something with "assert" in the name. I would say that anything
> with assert in the name is expected to behave like assert(), even if we
> don't intend to allow it to be disabled.
I notice that vg_assert() and sk_assert() are being used like this
frequently:
executable_name = strdup(buf);
vg_assert(NULL != executable_name);
Ie. using them not only for sanity checking (ie. if this fails we have a
bug) but also for error checking (ie. if this fails we ran out of memory).
In other words, the "no side-effects in assertions" rule is too loose; if
assertions can be removed, this sort of thing shouldn't be tolerated
either...
N
|