This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: stdint.h


On Sep 20 17:22, Ralf Corsepius wrote:
> On Tue, 2005-09-20 at 12:23 +0200, Corinna Vinschen wrote:
> >   When uncommenting every other problem in the file, there's also a bug
> >   in evaluating the INT32*_MIN values:
> > 
> >     INT32_MIN, INTLEAST32_MIN are printed as the positive value
> >     2147483648, not -2147483648.
> Check your preprocessed sources:
> ...
> long long arr3[] = {
>   INT8_MIN,
>   INT16_MIN,
>   INT32_MIN,
>   INT64_MIN,
> ...
> 
> Preprocessed:
> long long arr3[] = {
>   -128,
>   -32768,
>   -2147483648,
>   -9223372036854775808,
> 
> Also: cat printint.c
> #include <stdio.h>
> #include <stdint.h>
> #include <inttypes.h>
> 
> int main()
> {
>   printf( "%" PRId32 "\n", INT32_MIN);
> }
> 
> Preprocessed:
> ...
>   printf( "%" "d" "\n", -2147483648);
> ...
> 
> ./printint
> -2147483648
> 
> I'd say you've hit a bug in your GCC ;)

?!? Surprise, surprise.  Thanks for pointing out this problem.  Maybe
a bug in printf?  I'll have a look.


Corinna

-- 
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat, Inc.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]