[ipxe-devel] %lld format patch

Michael Brown mcb30 at ipxe.org
Wed Nov 4 08:35:13 UTC 2015

On 04/11/15 08:24, James Harper wrote:
> The following trivial patch adds support for %lld printf format. Currently, %lld will only take a 32 bit parameter from the stack which doesn't give the right answer and throws out the rest of the parameter list.

Even with this patch, the upper 32 bits (on a 32-bit platform) will be 
discarded when passed to format_decimal().

vsprintf.c currently deliberately omits support for %lld in order to 
avoid needing to drag in the support for 64-bit divisions.  I note that 
there is (my) code in time.c, ocsp.c and x509.c which erroneously uses 
%lld in debug messages to display seconds since the Epoch.

I would be tempted to amend these debug messages to use %#llx, rather 
than adding either incomplete or partial support for %lld, but I'm open 
to argument here.  What's your use case for %lld?


More information about the ipxe-devel mailing list