[RFA:] stdint.h: Add INTPTR_MIN, INTPTR_MAX, UINTPTR_MAX

Hans-Peter Nilsson hans-peter.nilsson@axis.com
Thu Apr 9 00:35:00 GMT 2009


> Date: Wed, 8 Apr 2009 20:03:10 -0400
> From: "Howland Craig D (Craig)" <howland@LGSInnovations.com>

> The first is related directly to the patch.  The problem is that when
> __PTRDIFF_TYPE__ is defined, PTRDIFF_MAX and PTRDIFF_MIN are used but
> they are not defined.

Are you reading the same stdint.h as I do?  CVS 1.13 has
PTRDIFF_MAX and MIN defined in the chunk that starts at line
410, regardless of __PTRDIFF_TYPE__ or __PTRDIFF_MAX__ for that
matter.  Unless I'm missing something.  And if I had, the
regtest would have caught it - or at least shown that it didn't
work. :)

> Secondly, not directly related to the patch, I noticed that the related
> part of stdint.h is not safe across all possible platforms.

I'm aiming for improvement, not for fixing up existing flaws (at
least not those that don't have practical impact).

> The part of stdint.h under scrutiny is (not showing the patch
> additions):
>  
> /*
>  * GCC doesn't provide an appropriate macro for [u]intptr_t
>  * For now, use __PTRDIFF_TYPE__
>  */

> Any other ideas?  (Maybe when this patch goes in, a FIXME note could be
> added for until a proper fix can be done.)

I'm all for that, but the quoted comment serves this purpose
IMHO.

brgds, H-P



More information about the Newlib mailing list