lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] How do I define the LWIP_PLATFORM_DIAG


From: Andrew Foster
Subject: Re: [lwip-users] How do I define the LWIP_PLATFORM_DIAG
Date: Wed, 24 Aug 2011 13:21:03 -0400
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.20) Gecko/20110817 Fedora/3.1.12-1.fc14 Lightning/1.0b3pre Thunderbird/3.1.12

What you are really after are the type formats used by your printf implementation. If you aren't trying to type check values passed as parameters, you can get away with the following defines:

   #define U8_F "c"
   #define S8_F "c"
   #define X8_F "x"
   #define U16_F "u"
   #define S16_F "d"
   #define X16_F "x"
   #define U32_F "u"
   #define S32_F "d"
   #define X32_F "x"

Alternatively, get rid of your "ud" and "ul" definitions and your problem should go away. "ud" and "ul" are not valid types for the printf function.

On 08/24/2011 12:58 PM, narke wrote:
Hi,

I tried to define as

#define S16_F "d"
#define U16_F "ud"
#define U32_F "ul"
#define S32_F "l"
#define X16_F "04x"
#define X32_F "08x"

#define LWIP_PLATFORM_DIAG(message) do { printf(message); } while(0)

but the compile results in strange warnings and errors. For example:

     LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE,
("dhcp_handle_nak(netif=%p) %c%c%"U16_F"\n",
"d:\woody\svn\CommUnit\port-lwip-1.4.0\lwip-1.4.0\src\core\dhcp.c",186
  Warning[Pe174]: expression has no effect
     LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE,
("dhcp_handle_nak(netif=%p) %c%c%"U16_F"\n",
"d:\woody\svn\CommUnit\port-lwip-1.4.0\lwip-1.4.0\src\core\dhcp.c",186
  Warning[Pe174]: expression has no effect
     LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE,
("dhcp_handle_nak(netif=%p) %c%c%"U16_F"\n",
"d:\woody\svn\CommUnit\port-lwip-1.4.0\lwip-1.4.0\src\core\dhcp.c",186
  Warning[Pe174]: expression has no effect
     LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE,
("dhcp_handle_nak(netif=%p) %c%c%"U16_F"\n",
"d:\woody\svn\CommUnit\port-lwip-1.4.0\lwip-1.4.0\src\core\dhcp.c",186
  Warning[Pe174]: expression has no effect
     LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE,
("dhcp_handle_nak(netif=%p) %c%c%"U16_F"\n",
"d:\woody\svn\CommUnit\port-lwip-1.4.0\lwip-1.4.0\src\core\dhcp.c",186
  Error[Pe167]: argument of type "u16_t" is incompatible with parameter
of type "char const *"


I have no idea about what's wrong with my definition.  Can anyone give
me an successful example?

Thanks in advance.



reply via email to

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