[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: |
Mon, 18 Jun 2007 07:48:59 +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 #18, task #6933 (project lwip):
A question about some asserts I seen. Take this sample from pbuf_free:
if (p == NULL) {
LWIP_ASSERT("p != NULL", p != NULL);
/* if assertions are disabled, proceed with debug output */
LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE | 2, ("pbuf_free(p == NULL) was
called.\n"));
return 0;
}
1/ in this case, the assert test isn't useful: you already know that (p ==
NULL). Isn't it better to directly call LWIP_PLATFORM_ASSERT?
2/ Just to understand, why do you have move the assert inside the "if (p ==
NULL)" (it was just before in previous code)? After all, it does the same
job...
3/ I would like to know why LWIP_ASSERT, LWIP_ERROR and LWIP_DEBUGF do the
job with a "do {...} while(0)" ? Why this do/while?
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/task/?6933>
_______________________________________________
Message posté via/par Savannah
http://savannah.nongnu.org/
- [lwip-devel] [task #6933] Review usage of ASSERT and error handling with LWIP_NOASSERT, (continued)
- [lwip-devel] [task #6933] Review usage of ASSERT and error handling with LWIP_NOASSERT, Frédéric Bernon, 2007/06/13
- [lwip-devel] [task #6933] Review usage of ASSERT and error handling with LWIP_NOASSERT, Simon Goldschmidt, 2007/06/13
- [lwip-devel] [task #6933] Review usage of ASSERT and error handling with LWIP_NOASSERT, Frédéric Bernon, 2007/06/13
- RE: [lwip-devel] [task #6933] Review usage of ASSERT and error handlingwith LWIP_NOASSERT, Goldschmidt Simon, 2007/06/13
- [lwip-devel] [task #6933] Review usage of ASSERT and error handling with LWIP_NOASSERT, Simon Goldschmidt, 2007/06/17
- [lwip-devel] [task #6933] Review usage of ASSERT and error handling with LWIP_NOASSERT, Frédéric Bernon, 2007/06/17
- [lwip-devel] [task #6933] Review usage of ASSERT and error handling with LWIP_NOASSERT, Simon Goldschmidt, 2007/06/17
- [lwip-devel] [task #6933] Review usage of ASSERT and error handling with LWIP_NOASSERT, Simon Goldschmidt, 2007/06/17
- [lwip-devel] [task #6933] Review usage of ASSERT and error handling with LWIP_NOASSERT, Frédéric Bernon, 2007/06/17
- [lwip-devel] [task #6933] Review usage of ASSERT and error handling with LWIP_NOASSERT, Simon Goldschmidt, 2007/06/17
- [lwip-devel] [task #6933] Review usage of ASSERT and error handling with LWIP_NOASSERT,
Frédéric Bernon <=
- [lwip-devel] [task #6933] Review usage of ASSERT and error handling with LWIP_NOASSERT, Simon Goldschmidt, 2007/06/18
- [lwip-devel] [task #6933] Review usage of ASSERT and error handling with LWIP_NOASSERT, Simon Goldschmidt, 2007/06/21
- [lwip-devel] [task #6933] Review usage of ASSERT and error handling with LWIP_NOASSERT, Frédéric Bernon, 2007/06/21
- [lwip-devel] [task #6933] Review usage of ASSERT and error handling with LWIP_NOASSERT, Simon Goldschmidt, 2007/06/22