h8300, m32c and PRIuPTR
Corinna Vinschen
vinschen@redhat.com
Mon Mar 16 14:10:00 GMT 2015
[Please don't CC me. I'm subscribed to the newlib list anyway. Thank you]
On Mar 16 07:38, Joel Sherrill wrote:
> On March 16, Corinna Vinschen wrote:
> >On Mar 15 17:02, Joel Sherrill wrote:
> >> ==================
> >> #include <stdio.h>
> >> #include <inttypes.h>
> >>
> >> void f( uintptr_t x)
> >> {
> >> printf( "%" PRIuPTR "\n", x );
> >> }
> >> ==================
> >>
> >> The warning is:
> >>
> >> f.c:6:3: warning: format '%u' expects argument of type 'unsigned
> >int', but
> >> argument 2 has type 'uintptr_t' [-Wformat=]
> >> printf( "%" PRIuPTR "\n", x );
> >> ^
> >> [...]
> >> Any ideas on how to address this?
> >
> >The m32r target requires building with multilibs, it seems. The fact
> >that the type doesn't match shows that configure didn't catch the right
> >base types for PRIuPTR and friends. For some cases it might be
> >necessary to set _UINTPTR_EQ_ULONG or _UINTPTR_EQ_ULONGLONG. Afaics,
> >this configure tests are yours.
>
> Yeah. I wrote the configure magic based on suggestions from the first
> round of discussions on how to solve this.
>
> It looks like h8300 and m32c can't be detected at configure time.
> Should I add logic to inttypes.h to check for them first before using
> the information from configure that is correct for the other targets?
Ideally the setting is available via compile time macros and can be used
to set _UINTPTR_EQ_ULONG or _UINTPTR_EQ_ULONGLONG from include/sys/config.h.
Corinna
--
Corinna Vinschen
Cygwin Maintainer
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20150316/49988e77/attachment.sig>
More information about the Newlib
mailing list