lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] bug report


From: Jeff Barber
Subject: Re: [lwip-users] bug report
Date: Fri, 5 Mar 2010 11:31:42 -0500

I can see a need for the Xnn_F stuff in a few cases (for example, with
scanf so that it knows the integer size to store, or when printing
something that might be longer than some machines' standard integer
length such as u32_t on a 16-bit machine). However IMO it's really
ugly and shouldn't be used unless needed.

Can you explain why it is necessary in this case?  The u8_t values
should be automatically promoted to "standard integer" length.

(And, actually, the same argument can be made with respect to the
u16_t type being printed here with %hx -- %x should work just fine
with the standard promotion.)

Jeff

On Fri, Mar 5, 2010 at 9:01 AM, Martin Velek <address@hidden> wrote:
> Please could someone post this bug? I do not know how to find out my
> lost username to log-in.
>
> Category:       LWIP_DEBUGF     Severity:       3 - Normal
> Item Group:     Faulty Behaviour        Status:         Open
> lwIP version:   1.3.2
>
> In the file etharp.c, line 1155 in debug mode, the mac addresses and
> frame type are defined as:
> "ethernet_input: dest:%02x:%02x:%02x:%02x:%02x:%02x,
> src:%02x:%02x:%02x:%02x:%02x:%02x, type:%2hx\n",
>
> This format string violates some non-sprintf functions. Every port has
> in the cc.h  /* Define (sn)printf formatters for these lwIP types */.
> I would suggest to change to "ethernet_input:
> dest:%02"X8_F":%02"X8_F":%02"X8_F":%02"X8_F":%02"X8_F":%02"X8_F",
> src:%02"X8_F":%02"X8_F":%02"X8_F":%02"X8_F":%02"X8_F":%02"X8_F",
> type:%2"U16_F"\n"
>
> + check the source code if there are other places with "hardcoded" values.
>
> Regard,
> Martin
>
>
> _______________________________________________
> lwip-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/lwip-users
>




reply via email to

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