[Top][All Lists]

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

[lwip-devel] [task #6933] Review usage of ASSERT and error handling with

From: Frédéric Bernon
Subject: [lwip-devel] [task #6933] Review usage of ASSERT and error handling with LWIP_NOASSERT
Date: Wed, 13 Jun 2007 13:03:28 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv: Gecko/20070515 Firefox/

Follow-up Comment #9, task #6933 (project lwip):

>Because of that, I wouldn't call it LWIP_FATAL. Giving a wrong argument
isn't fatal. 

What is "fatal" is to continue with a such argument.

>Still I'm OK with changing the if(..) return ..; to something else. I don't
think that including 'return ERR_ARG;' in LWIP_FATAL() is a good solution,
though. It might be better to call id LWIP_CHECK_ARG() and give 'return X;'
as another argument to that define...

Sorry, I don't really see (except the name) what is the difference between

LWIP_FATAL("netconn_close: invalid conn", (conn==NULL), {return ERR_ARG;}); 

...and this...

LWIP_CHECK_ARG(conn != NULL, return ERR_ARG);

Except the message with is important to give an information, and the "!=" (it
avoid to add the "!" in the evaluation).

Last about the name, LWIP_CHECK_ARG is not so good (you could do that on an
expression, not only an argument). I propose you to use LWIP_ERROR (which is
currently not used, so, we can change it)...


Reply to this item at:


  Message posté via/par Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]