[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 16:03:36 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv: Gecko/20070515 Firefox/

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

>I thought you wanted to integrate the 'return X;' into the definition of
LWIP_FATAL, must have misunderstood that...

No, the "h" parameter for LWIP_ERROR is to define a good action in the
function context when we got error, but it's not always the same action:
sometimes we have to return a err_t (like for netconn_send), sometimes a
netbuf* (like for netconn_recv)...

So, in debug.h, we will add:

#ifndef LWIP_ERROR
#define LWIP_ERROR(m,e,h) if (e) { LWIP_PLATFORM_ASSERT(m); h;};

In api_lib.c, in netconn_close, we will replace the current ASSERT by :

LWIP_ERROR("netconn_close: invalid conn", (conn==NULL), {return RR_ARG;}); 

I update this part if you want (or you do it, like you want...).


Reply to this item at:


  Message posté via/par Savannah

reply via email to

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