lwip-devel
[Top][All Lists]
Advanced

[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: Mon, 11 Jun 2007 12:20:12 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4

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

For api_lib.c patch, I'm disagree with you: we have replace the "conn==NULL"
check by assert, because it's most an application programmer task (always
done when you have good developers in your team) and it's redundant here
(more cycles & footprint).

If your really want to handle such cases inside your code, why not something
like (defined or not, perhaps with a define in cc.h):

#define LWIP_ASSERT2(x,y,ret) do { if(!(y)) { LWIP_PLATFORM_ASSERT(x); return
ret;} while(0)

And let each one decide to handle or not such checks in there production
code

More, for the same reason we have do this change, I propose to replace in
sockets.c any code like this... "if (!sock) return -1;" ...by an assert (once
again, it's at the application to check that, like it check to pass an valid
value to API).



    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/task/?6933>

_______________________________________________
  Message posté via/par Savannah
  http://savannah.nongnu.org/





reply via email to

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