printf/inttypes.h warning
Corinna Vinschen
vinschen@redhat.com
Tue Dec 16 13:29:00 GMT 2014
[Please don't CC me. Thanks]
On Dec 16 05:17, Joel Sherrill wrote:
> On December 16, 2014 2:24:06 AM PST, Corinna Vinschen <> wrote:
> >On Dec 15 18:55, Joel Sherrill wrote:
> >> Now that I have looked a bit into the GCC side, I think it is kind of
> >> newlib's fault. :)
> >> newlib-stdint.h has this:
> >>
> >> /* Newlib uses the unsigned type corresponding to ptrdiff_t for
> >> uintptr_t; this is the same as size_t for most newlib-using
> >> targets. */
> >> #define INTPTR_TYPE PTRDIFF_TYPE
> >> #ifndef UINTPTR_TYPE
> >> #define UINTPTR_TYPE SIZE_TYPE
> >> #endif
> >
> >Where are you looking?!? If I look into newlib's HEAD, I see only this
> >in libc/include/stdint.h:
> >
> > #ifdef __INTPTR_TYPE__
> > #define INTPTR_MIN (-__INTPTR_MAX__ - 1)
> > #define INTPTR_MAX __INTPTR_MAX__
> > #define UINTPTR_MAX __UINTPTR_MAX__
> > #elif defined(__PTRDIFF_TYPE__)
> > #define INTPTR_MAX PTRDIFF_MAX
> > #define INTPTR_MIN PTRDIFF_MIN
> > #ifdef __UINTPTR_MAX__
> > #define UINTPTR_MAX __UINTPTR_MAX__
> > #else
> > #define UINTPTR_MAX (2UL * PTRDIFF_MAX + 1)
> > #endif
> > #else
> >
> >And this in libc/include/machine/_default_types.h:
> >
> > #ifdef __INTPTR_TYPE__
> > typedef __INTPTR_TYPE__ __intptr_t;
> > #ifdef __UINTPTR_TYPE__
> > typedef __UINTPTR_TYPE__ __uintptr_t;
> > #else
> > typedef unsigned __INTPTR_TYPE__ __uintptr_t;
> > #endif
> > #elif defined(__PTRDIFF_TYPE__)
> > typedef __PTRDIFF_TYPE__ __intptr_t;
> > typedef unsigned __PTRDIFF_TYPE__ __uintptr_t;
> > #else
> > typedef long __intptr_t;
> > typedef unsigned long __uintptr_t;
> > #endif
> >
> >The code you pasted above is nowhere to be seen. Also, as far as the
> >definition of the double underscored macros, __INTPTR_MAX__,
> >__INTPTR_TYPE__, etc is concerned, this is GCC territory, not newlib.
> >Am I missing something (again)?
> >
>
> It is GCC. gcc/config/newlib-stdint.h where GCC defines the types.
Ok, I didn't know there's newlib-specific stuff in GCC. I'm just
not sure in how far this is newlib's fault. The usage of __INTPTR_TYPE__
looks right to me. The gcc/config/newlib-stdint.h file seems to be
outdated???
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/20141216/1fea266d/attachment.sig>
More information about the Newlib
mailing list