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 12:50:15 -0500

On Fri, Mar 5, 2010 at 11:44 AM, Kieran Mansley <address@hidden> wrote:

> I think his point is that we're assuming that %x exists on his platform
> by hardcoding %02x in the code, whereas on his platform he needs to use
> something other than %x to get a hex output.

I suppose I could buy that.  It would seem that the particular line
being cited would in that case be only the tip of the iceberg.  There
are boatloads of %d, %u, %p, and other %x specifications sprinkled
liberally throughout the lwip code.

> The shorter-than-32-bit modifiers are needed because we only want to
> print out 2 characters for each byte of the MAC address.  If we just
> used a standard %x or it got promoted as such you'd have very hard to
> read MAC addresses being output.

Each u8_t can only hold one byte and the integer promotion rules of C
guarantee that the "unsigned int" to which it is promoted represents
the same value (<= 0xff).  How can it require more than two
characters?

Jeff




reply via email to

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