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: Simon Goldschmidt
Subject: [lwip-devel] [task #6933] Review usage of ASSERT and error handling with LWIP_NOASSERT
Date: Mon, 18 Jun 2007 16:07:09 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4

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

> 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

I'd prefer calling LWIP_ASSERT("...", 0) instead of directly calling
LWIP_PLATFORM_ASSERT, since that isn't undefined with LWIP_NOASSERT!

> 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...

Exactly. And because of that, I wanted to have only _one_ if-statement to
make the code better to read...

> 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?

That's because the do/while is the most portable way to make a
function-like-define work in most places, I think. Don't ask me for examples,
though!

    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.nongnu.org/





reply via email to

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