mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@aerifal.cx>
To: musl@lists.openwall.com
Cc: Matthew Fernandez <matthew.fernandez@nicta.com.au>
Subject: Re: printf format macros
Date: Mon, 28 Oct 2013 22:46:18 -0400	[thread overview]
Message-ID: <20131029024617.GS20515@brightrain.aerifal.cx> (raw)
In-Reply-To: <526F1D46.30604@nicta.com.au>

On Tue, Oct 29, 2013 at 01:28:22PM +1100, Matthew Fernandez wrote:
> Hi all,
> 
> This may be a silly question, but why does there seem to be no 64-bit
> compatibility in the printf macros in inttypes.h? The relevant section is:
> 
> 25 #if UINTPTR_MAX == UINT64_MAX
> 26 #define __PRI64  "l"
> 27 #else
> 28 #define __PRI64  "ll"
> 29 #endif
> 
> as compared to Glibc's:
> 
> 49 # if __WORDSIZE == 64
> 50 #  define __PRI64_PREFIX    "l"
> 51 #  define __PRIPTR_PREFIX   "l"
> 52 # else
> 53 #  define __PRI64_PREFIX    "ll"
> 54 #  define __PRIPTR_PREFIX
> 55 # endif
> 
> We use Musl C on 32- and 64-bit platforms and I'm looking for a way to
> write printf format strings word-length-independently in an application.
> I'm not currently subscribed to the list so please CC me personally when
> replying.

I was at first confused, but it looks like the PRI?PTR macros are
incorrect on musl for 32-bit archs. At worst you'll get warnings, so
you can use them all correctly right now, but it's something we should
fix before the next release.

Rich


      reply	other threads:[~2013-10-29  2:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-29  2:28 Matthew Fernandez
2013-10-29  2:46 ` Rich Felker [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131029024617.GS20515@brightrain.aerifal.cx \
    --to=dalias@aerifal.cx \
    --cc=matthew.fernandez@nicta.com.au \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).