Re: is assert() an appropriate substitute for return -1?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 28, 2011 at 5:51 AM, Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> wrote:
>> Is it worth supplying patches?
>
> I read once in the manpages that you can disable assert() macro with NDEBUG.
>
> Is that enough for you?

No, this only changes the signal number (instead of terminating with
SIGABRT, process will terminate with SISEGV when the null pointers are
used).

The asserts could be changed to #define argassert(x)
if(!x){errno=EINVAL; return -1;} -- mostly the asserts occur before
anything is done that would require cleanup.

Cheers,
Sam
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux